Open file handle.
Object.OpenNewFile(tcFileName [, ttCreated [, llIWontUTF8 [, lcPassword, liCRC32]]])
XFRX 22.0
Object.OpenNewFile(tcFileName [, ttCreated [, llIWontUTF8 [, lcPassword, liCRC32 [, llBIGFile [, lcComment]]]]])
Parameters
tcFileName
File name in ZIP archive.
ttCreated
Datetime created.
llIWontUTF8
A wish uses UTF-8 for encoding file name.
For UTF-8 encoding or password is needy zlib.dll version 1.25 or higher.
lcPassword
File password.
liCRC32
File CRC32 checksum. It is mandatory for lcPassword. Checksum is for all data.
llBIGFile
Specifies if you want write more then 4GiB data.
lcComment
File comment.
Return values
Number
Value | Description |
---|---|
0 | File append to ZIP archive |
-102 | Bad paremeters. (ZIP_PARAMERROR) |
-103 | File is not a zip file. (ZIP_BADZIPFILE) |
-104 | Internal at error at zipping data. (ZIP_INTERNALERROR) |
Remarks
Applies To: XFRX#ZIP
See also
CloseFile Method
WriteData Method
Examples
LOCAL m.loZIP, m.lcZIPFile, m.lcFile m.lcZIPFile="c:\temp\_big.zip" m.loZIP = EVALUATE([xfrx("XFRX#ZIP")]) IF m.loZip.openArchive(m.lcZIPFile) m.lcData=SYS(0)+" "+TTOC(DATETIME()) m.loZip.OpenNewFile("myFile") m.loZip.WriteData(m.lcData) m.loZip.CloseFile() m.lcData=SYS(0)+" "+TTOC(DATETIME()) m.loZip.OpenNewFile("myFile+Datetime", {^2022-01-01}) m.loZip.WriteData(m.lcData) m.loZip.CloseFile() m.lcData=SYS(0)+" "+TTOC(DATETIME()) m.loZip.OpenNewFile("myFile+Datetime+National+Characters - "+"bílý žluťoučký kůň", {^2022-01-01}, .T.) m.loZip.WriteData(m.lcData) m.loZip.CloseFile() m.lcData=SYS(0)+" "+TTOC(DATETIME()) m.loZip.OpenNewFile("myFile+Datetime+ěščřž+password", {^2022-01-01}, .T., "mypwd", loZIP.SYS2007(m.lcData)) m.loZip.WriteData(m.lcData) m.loZip.CloseFile() m.lcData=SYS(0)+" "+TTOC(DATETIME()) m.loZip.OpenNewFile("myFile+Datetime+ěščřž+password+file comment", {^2022-01-01}, .T., "mypwd", loZIP.SYS2007(m.lcData), .F., "my file comment") m.loZip.WriteData(m.lcData) m.loZip.CloseFile() m.loZip.closearchive("ěščřžýáíé") ENDIF RELE m.loZIP