Functions dfApplyN and dfApplyH are used to apply a df-file, i.e. to restore a new file having an existing old file and df-file.
int dfApplyN (
int dfApplyH (
Special df-file descriptor, created by dfOpenDfFile function.
Name of an old file.
May be skipped if an old file was skipped when creating df-file. (Field nOldFileSize of TDfCmp structure is equal to "-1").
Name of a new file.
Can be NULL value or empty string for verification purpose.
Flags which define the procedure of df-file applying.
Possible values are: "0" or free combination of the following flags:
Do not change last modification date/time of the new file.
If new file already exists then its last modification date/time is not changed.
Otherwise an old file's last modification date/time is taken.
Same as for DFAF_DONT_CHG_DATETIME, but for the value of new file's attributes.
Same as for DFAF_DONT_CHG_DATETIME, but for the new file content.
This flag prescribes to delete an old file after df-file applying in case of old and new files are not identical.
Valid only within dfApplyN function.
Default value: "0".
Pointer on the structure of interaction with application program (see description of the structure TDfInteract).
May be NULL.
Old file descriptor.
Can be INVALID_FD_VALUE value, if old file was skipped when creating df-file. (Field nOldFileSize of TDfCmp structure is equal to "-1").
New file descriptor.
Can be INVALID_FD_VALUE value or empty string for verification purpose.
If the function succeeds, the return value is zero (EDF_SUCCESS).
If the function fails, the return value is one of the following:
szOldFileName and szNewFileName may point on the same file. Then in case of successful df-file applying an old file is replaced by a new one.
hOldFile è hNewFile must represent different files when updating file.
At the moment of df-file applying a new file may already exist. Its replacement is implemented only after ensuring that new file restoration completed successfully (restoration is performed to a temporary file which then replaces the already existing one). That is why you can you can ensure that in case of any error the existing file will not be changed.
An moreover if the restored file replaces the already existing file and the existing file is on NTFS volume, then an attempt to pass the access permissions from the existing file to the restored one will me made.
It is necessary to mark that replacement of the already existing file is implemented only in case of file content updating.
These functions can determine the situation when an attempt to update the already patched file is made (in case of file content updating). Such situation can occur if you try to update the already updated file. In this case the function returns EDF_ALREADY_PATCHED error code.