xzopen2.vi

Opens a gzip (.gz) file for reading or writing. In contrast to xzopen xzopen2 allowes setting of some gzip-header-elements:

comment: Commentstring (may be empty)

origname: Original filename (may be empty)

filetime: Orig. date/time of file (seconds since 1970, may be 0)

xf_len: No. of Bytes to reserve in extra-field (may be 0)

xfield: extra-field-data (may be empty)

xzopen2 returns a NULL fileHandle and 0 as Result if the file could not be opened or if there was insufficient memory to allocate the (de)compression state.


Connector Pane

xzopen2.vi


Controls and Indicators

cstr

path

Full pathname of file to open/create.

cstr

mode

Combine following into one mode-string:

Readmode:

"r","r+","rb" or "r+b"

r=read

b=binary (also text with CR and/or LF)

+=allows writing too (setting extrafield)

Writemode:

"w","w+", "wb" or "w+b"

w=write

b=binary (also text with CR and/or LF)

+=allows reading too (to read header-fields)

Compressionlevel (in Writemode only):

"0" = no compression,

"1".."9" for higher but slower compression

Strategy (in Writemode only):

"f" for filtered data

"h" for Huffmann only compression

cu32

filetime

Original date/time of file in packed format.

Seconds since 1.1.1970.

cu16

xf_len

If xfield is empty, xf_len sets the reserved size for the extra-field in the gz-header (filled with zeroes). If xfield is NOT empty xf_len is ignored and xfield is copiied to the extra-field.

cstr

xfield

If xfield is empty, xf_len sets the reserved size for the extra-field in the gz-header (filled with zeroes). If xfield is NOT empty xf_len is ignored and xfield is copiied to the extra-field.

cstr

origname

Original path and filename.

cstr

comment

The comment string.

idlrn

fileHandle

ii32

Result