IncludeFiles Method

Specifies that the indicated files should be added to the archive.

Syntax

ANSI (Cross Platform)
int IncludeFiles(const char* lpszfilenames);

Unicode (Windows)
INT IncludeFiles(LPCWSTR lpszfilenames);
- (void)includeFiles:(NSString*)filenames;
#define MID_TAR_INCLUDEFILES 9

IPWORKSZIP_EXTERNAL int IPWORKSZIP_CALL IPWorksZip_Tar_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

IncludeFiles may be used before Compress, to specify the files to be compressed. Invoking this method populates the Files collection accordingly.

Invoking the method does not create or alter the archive.

The argument should be a pipe ("|") -delimited sequence of one or more filenames. The filenames should be specified with paths if necessary, so that the files may be found on the local file system. The filenames will be stored as is in the FileDecompressedName field, and without a pathname in the FileCompressedName field of the Files collection.

Filenames may include the wildcards '?', '*', and '[ .. ]'. '?' will match any single character, and '*' will match an arbitrary sequence of characters. '[ .. ]' may be used to match any of the characters inside, or a range, such as '[a-z]'. A '\' can be used to escape wildcard characters.

If wildcards are specified, the file system will be scanned and all files matching the specified mask will be added. Moreover, subdirectories will be recursed into if RecurseSubdirectories is set to true. When recursing into subdirectories, relative path information will be stored in FileCompressedName field of the Files collection.

The ExcludedFiles may be used to limit the files to be compressed. This property is checked when Compress is invoked, rather than when IncludeFiles is invoked, so this property may be set before or after invoking IncludeFiles.

Note that invoking IncludeFiles will not reset the class, or remove old values of FileCompressedName and FileDecompressedName. This may be done by first clearing the Files collection.

Example


ZipControl.IncludeFiles("c:\test\* | c:\readme")
ZipControl.ExcludedFiles = "*.tmp"
ZipControl.Compress()

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks ZIP 2020 C++ Edition - Version 20.0 [Build 8300]