Codex API: Archives

CreateMergedArchive

The CreateMergedArchive function creates or updates an archive.

 

VOID CreateMergedArchive(
    LPCTSTR lpArchive,    // archive to create
    LPCTSTR lpRecurse,    // files to recursively compress
    LPCTSTR lpNormal,     // files to compress
    LPCTSTR lpProfile     // compression profile to use
);

Parameters

lpArchive

[in] Pointer to a null-terminated string that specifies the full path of the archive to create or update. The archive must contain a valid archive extension that is supported for compression. Use the GetCompressibleArchivesEx function to obtain a list of archives supported for compression.

If the archive does not already exist, it will be created.
If the archive already exists, it will be updated only if the plug-in supports updating of existing archives.

lpRecurse

[in] Pointer to a null-terminated string formatted as COMMATEXT specifying the list of files to compress recursively. UNC paths are accepted. Wildcards are accepted.

Folders will be compressed with all their files and subfolders. Files will be compressed with all matching files in subfolders as well.

To preserve folder information in your archives, make sure you specify only the top level folder of the tree you wish to compress. The archive type also must support folder information storage and the profile must allow folder storage.

Pass NULL in this parameter to indicate no files will be recursively compressed.

lpNormal

[in] Pointer to a null-terminated string formatted as COMMATEXT specifying the list of files to compress non-recursively. UNC paths are accepted. Wildcards are accepted.

Folders will be compressed with all files they contain.

Pass NULL in this parameter to indicate no files will be normally compressed.

lpProfile

[in] Pointer to a null-terminated string specifying the compression profile to use. Use the GetCompressionProfilesEx function to obtain a list of available profiles by each archive type.

The indicated profile must exist.

It is recommended that you only use the "Default" profile, which is guaranteed to exist if the archive is compressible.

Return Values

This function does not return any values.

Remarks

CreateMergedArchive invokes the compression plug-in mapped to the given archive type. The plug-in is responsible for displaying progress and feedback to the user. The plug-in must also handle error conditions. CreateMergedArchive returns once the invoked plug-in completes processing.

CreateMergedArchive
combines all files specified in the lpRecurse and lpNormal parameters into a single output archive. There are some archive types for which this might not be suitable, such as GZIP or BZIP2 archives which cannot contain more than a single file inside an archive. Use the CreateSingularArchives function to handle such archive types.

Requirements

Windows NT/2000/XP: Requires Windows NT 4.0 SP4 or later.
Windows 95/98/Me:
Requires Windows 98 (or Windows 95 with DCOM 1.2).
Header:
Declared in mCodexAPI.h.
Library:
Use mCodexAPI.dll.

See Also

Codex API Overview, Codex API Functions, GetCompressibleArchivesEx, GetCompressionProfilesEx, CreateSingularArchives, ExtractArchive, COMMATEXT