|
|
|
|
Describes how path infromation will be stored for the file or directory within the archive file.
Unit
ZipForge
type TZFStorePath = (spNoPath, spRelativePath, spFullPath, spFullPathWithDrive);
Description
TZFStorePath value defines how path information will be stored for the file or directory within the archive file. If you need to store all files and directories without path you should use spNoPath value. For example, AddFiles('C:\TEST\test.txt') adds file test.txt to the archive. If you will extract it by ExtractFiles('*.*') and BaseDir will be 'C:\', file test.txt will be extracted to 'C\':, not to 'C:\TEST'.
If you need to store path relative to certain directory you should set BaseDir before adding file to archive and set Options.StorePath to spRelative. In this case if you will set BaseDir to 'C:\' and call AddFiles('C:\TEST\test.txt') the file test.txt will be stored as 'TEST\test.txt' within the archive. If you will extract it by ExtractFiles('*.*') it will be extracted to 'C:\TEST\test.txt', not to 'C:\' as in previous example.
If you need to store full path you should set Options.StorePath to spFullPath. Previous example will store test.txt within the archive file as '\TEST\test.txt' and file will be extracted to disk specified by BaseDir.
If you need to store absolute path with drive you should set Options.StorePath to spFullPathWithDrive. Previous AddFiles example will store test.txt within the archive file as 'C:\TEST\test.txt' and the file will be extracted to disk using stored absolute path regardless of BaseDir.
Options.StorePath can be set to any of the following values:
Value
|
Meaning
|
spNoPath
|
No path information stored
|
spRelativePath
|
Path information stored relatively BaseDir
|
spFullPath
|
Path information stored relatively disk specified by BaseDir
|
spFullPathWithDrive
|
Absolute path with drive letter stored. Non-standard extension of PKZip format.
|
Note:
Be aware that use of spFullPathWithDrive may lead to the incompatibility with the most Zip utilities supporting PKZip format without this non-standard extension.
|
|