Click or drag to resize
FileInfoReplace Method (String, String, Boolean)
Replaces the contents of a specified file with the file described by the current FileInfo object, deleting the original file, and creating a backup of the replaced file. Also specifies whether to ignore merge errors.

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

Parameters

destinationFileName
Type: SystemString
The name of a file to replace with the current file.
destinationBackupFileName
Type: SystemString
The name of a file with which to create a backup of the file described by the destinationFileName parameter.
ignoreMetadataErrors
Type: SystemBoolean
to ignore merge errors (such as attributes and ACLs) from the replaced file to the replacement file; otherwise, .

Return Value

Type: FileInfo
A FileInfo object that encapsulates information about the file described by the destinationFileName parameter.
Remarks
The Replace method replaces the contents of a specified file with the contents of the file described by the current FileInfo object. It also creates a backup of the file that was replaced. Finally, it returns a new FileInfo object that describes the overwritten file.
Remarks
Pass null to the destinationBackupFileName parameter if you do not want to create a backup of the file being replaced.
See Also