The ReplacingFile event is triggered whenever a file is about to be overwritten in the unzipping destination, or in the destination zip file.
The ReplacingFile event's bReplaceFile parameter allows you to determine whether or not to replace the file. The default value of the bReplaceFile parameter is True, so if you do not write a handler for this event, files will be replaced. Setting the bReplaceFile parameter to False will prevent files from being overwritten.
Only the bReplaceFile parameter of the SkippingFile event is modifiable, all other parameters are there only to provide information about the file about the new file and the destination file.
If you want to rename files that already exist in the destination, then you should use the ZipPreprocessingFile or UnzipPreprocessingFile events. These events have a bExisting parameter which tells you whether or not the destination file exists, and allows you to perform many possible actions, including renaming the file or changing its path.
Declaration | |
---|---|
|
Declaration (DLL API) | |
---|---|
xcdReplacingFileParams * pParams = ( xcdReplacingFileParams * ) lParam; |
Parameter | Modifiable | Description |
---|---|---|
sFilename | NO | The path and filename of the destination file that may be replaced by the new file that has the same path and filename. |
sComment | NO | The new file's comment. |
lSize | NO | The new file's uncompressed size, in bytes. |
lSizeLow lSizeHigh (64) |
NO | The 32 low-order and high-order bits representing the new file's uncompressed size, in bytes. |
xAttributes | NO | The new file's attributes. |
dtLastModified | NO | The new file's last modification date and time stamp. |
dtOrigLastAccessed | NO | The new file's last accessed date and time stamp. |
dtCreated | NO | The new file's creation date and time stamp. |
lOrigSize | NO | The destination file's uncompressed size, in bytes. |
lOrigSizeLow lOrigSizeHigh (64) |
NO | The 32 low-order and high-order bits representing the destination file's uncompressed size, in bytes. |
xOrigAttributes | NO | The destination file's attributes. |
dtOrigLastModified | NO | The destination file's last modification date and time stamp. |
dtOrigLastAccessed | NO | The destination file's last accessed date and time stamp. |
dtOrigCreated | NO | The destination file's creation date and time stamp. |
bReplaceFile | YES | Set this to True (default) to replace the destination file by the new one, or set it to False to keep the destination file. |