Click or drag to resize
FileReplace Method (String, String, String, Boolean)
Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file and optionally ignores merge errors.

Namespace: Alphaleonis.Win32.Filesystem
Assembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax
public static void Replace(
	string sourceFileName,
	string destinationFileName,
	string destinationBackupFileName,
	bool ignoreMetadataErrors
)

Parameters

sourceFileName
Type: SystemString
The name of a file that replaces the file specified by destinationFileName.
destinationFileName
Type: SystemString
The name of the file being replaced.
destinationBackupFileName
Type: SystemString
The name of the backup file.
ignoreMetadataErrors
Type: SystemBoolean
to ignore merge errors (such as attributes and access control lists (ACLs)) from the replaced file to the replacement file; otherwise, .
Remarks
The Replace method replaces the contents of a specified file with the contents of another file. It also creates a backup of the file that was replaced.
Remarks
If the sourceFileName and destinationFileName are on different volumes, this method will raise an exception. If the destinationBackupFileName is on a different volume from the source file, the backup file will be deleted.
Remarks
Pass null to the destinationBackupFileName parameter if you do not want to create a backup of the file being replaced.
See Also