5.37.5 ADD
The ADD command adds files, directories and child directories to the current archive (the archive last successfully opened using the CREATE or OPEN command) in the current instance of the ZipService.
Either the PATH or FILE keyword must be specified. If both keywords are specified only the PATH keyword will be processed.
Specify the folders or files to be added using either the PATH or FILE keywords. For each of these keywords you can specify a single folder or file, or you can provide a list of entries to be added.
Syntax:
Command
|
Keyword
|
Value
|
Developer notes
|
ADD
|
FILE
|
value
|
Conditional.
Specify either the FILE or PATH keywords. If you specify both. only the PATH keyword will be processed.
Specifies the paths for one or more directories or files to be added to the current archive. You can specify this keyword in one of two ways:
File path specifies the path of a single directory or file to be added to the current archive.
|
*LIST
|
Specifies a working list is provided with the command. This list includes the paths of one or more directories or files to be added to the current archive.
The working list can have one or two fields: The first field is expected to contain the paths of the directories or files. The optional second field can be used to specify the BASE value (refer to <BASE>) that applies to the directory or file identified by the list entry. If the second field is not provided, or if it is provided but is blank, *NONE is assumed for the BASE value.
If you specify relative paths, the ZipService will look for the directories or files relative to the JSM instance directory.
|
PATH
|
value
|
Specifies the paths for one or more directories or files to be added to the current archive. You can specify this keyword in one of two ways:
File path specifies the path of a single directory or file to be added to the current archive.
Specify either the PATH or FILE keywords. If you specify both only the PATH keyword will be processed.
|
*LIST
|
Specifies a working list is provided with the command. This list includes the paths of one or more directories or files to be added to the current archive.
The working list can have one or two fields. The first field is expected to contain the paths of the directories or files. An optional second field can be used to specify the BASE value (refer to <BASE>) that applies to the directory or file identified by the list entry. If the second field is not provided, or if it is provided but is blank, *NONE is assumed for the BASE value.
If you specify relative paths, the ZipService will look for the directories or files relative to the JSM instance directory.
|
BASE
|
|
This keyword is used in conjunction with the PATH keyword. The BASE keyword controls how the path information is stored for each entry in the zip archive.
By specifying an appropriate value for this keyword, you can avoid the full path being stored for each zip entry – instead you can specify that the stored path should be relative to a common root path. This is useful when the contents of the zip archive are to be extracted on a system that has a different directory structure to the source machine
If you populate the zip archive with more than one ADD command, you should take care to specify consistent and compatible values on each instance of the ADD command. This is to ensure a consistent path structure in the resulting zip archive.
|
path
|
Nominate a path to be used as the relative path for all files in the zip archive.
|
*CURRENT
|
Indicates the path stored in the zip file is relative to the directory containing the entries being added to the zip file.
|
*PARENT
|
Indicates the path stored in the zip file is relative to the parent of the directory containing the entries being added to the zip file.
|
*NONE
|
Indicates the paths stored in the zip archive are not modified The default value.
|
TREE
|
*NO
|
This keyword is used in conjunction with the PATH keyword and specifies if child directories should be included in the zip archive. Child directories and their contents are not added.
|
*YES
|
The child directories of the specified directory(s) and their contents will be added to the current archive. If the child directories themselves contain further directories, those directories and their contents are also added, and so on until all the descendants of the specified directory(s) are added. This is the default.
|
|
Example
ADD FILE(*LIST) #WRKLST(NAME)
ADD FILE(/folder/file.pdf) BASE(/)
ADD FILE(/folder/file.pdf) BASE(*CURRENT)
ADD FILE(/folder/file.pdf) BASE(/folder)
ADD PATH(/folder/folder) BASE(*NONE)