ZipLocalFileRecord
|
Previous Top Next |
Each Zip File Entry consists of a Local File Record followed by the compressed or stored Data. This Local File Record does not contain any File Attribute information nor File Comments, but otherwise contains all the information to recreate the (File) Entry. It is basically a subset of the corresponding Central Directory Record, which is located at the end of the Zip File, in the Central Directory.
|
|
This Local File Record is represented as a Structure in the XbZLib implementation. The following is the format of the Local File Record, as defined in the file "XbZLibSt.prg":
|
STRUCTURE ZipLocalFileRecord
|
CHAR Signature SIZE 4 // "PK" + chr(3) + chr(4)
|
UINT VerToExtract // Set to 2.0 - DOS, Windows, OS/2 (FAT/VFAT/NTFS)
|
UINT GPFlag // Set to "0" (Currently IGNORED)
|
UINT CompMethod // Only "0" (Stored) and "8" (Deflated) are supported
|
CHAR FileTime SIZE 4
|
CHAR CRC SIZE 4
|
ULONG CompSize
|
ULONG UnCompSize
|
UINT FNameLen
|
UINT ExtraFldLen // Set to "0" (Currently IGNORED)
|
CHAR FileName
|
CHAR ExtraFld // Set to "" (Currently IGNORED)
|
ENDSTRUCT
|
The following Example code creates an empty Local File Record object and sets some values:
|
LOCAL oLFRec := ZipLocalFileRecord():New()
|
oLFRec:Signature := XBZ_LOCAL_FILE_RECORD
|
oLFRec:FileName := "SomeFileName"
|
oLFRec:FNameLen := len(oLFRec:FileName)
|
|