|
|
|
|
Adds files to the archive.
procedure AddFiles; overload;
procedure AddFiles(
FileMask: String;
SearchAttr: Word = faAnyFile-faDirectory;
ExclusionMask: String = ''); overload;
Description
Use AddFiles to add files to the open archive file. If you need to delete source files, use MoveFiles instead of AddFiles. If Options.Recurse is set to True, AddFiles will search files recursively.
AddFiles variant without parameters uses FileMasks, ExclusionMasks and Options.SearchAttr to specify search conditions and to exclude files from add operation.
The FileMask parameter is the directory and file name mask, including wildcard characters. For example, 'C:\TEST\*.*' specifies all files in the C:\TEST directory. All files that meets FileMask and SearchAttr will be added to the archive.
The SearchAttr parameter specifies the special files to include in addition to all normal files. This parameter is similar to the Attr parameter in FindFirst function from SysUtils unit. You can set it to any combination of faReadOnly, faHidden, faSysFile, faVolumeID, faDirectory, faArchive constants defined in SysUtils or value faAnyFile meaning that any file meets search condition.
If you would like to process files without Archive attribute, you should specify $80 constant in addition to other attributes combination.
If NTFS files created by another user are to be added into archive, then it will be necessary to add $2000 constant to SearchAttr.
If compressed NTFS files are to be added into archive, then it will be necessary to add $800 constant to SearchAttr.
The ExclusionMask specifies files to be excluded from add operation.
Note: If you need to add certain files without compression set NoCompressionMasks property. If some errors occurs an exception will be raised. Write an OnProcessFileFailure event handler to perform your own error handling.
Note: If you need to change the name of the added file, use OnStoreFile event handler.
|
|