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.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public FileInfo Replace(
string destinationFileName,
string destinationBackupFileName,
bool ignoreMetadataErrors
)
Public Function Replace (
destinationFileName As String,
destinationBackupFileName As String,
ignoreMetadataErrors As Boolean
) As FileInfo
public:
FileInfo^ Replace(
String^ destinationFileName,
String^ destinationBackupFileName,
bool ignoreMetadataErrors
)
member Replace :
destinationFileName : string *
destinationBackupFileName : string *
ignoreMetadataErrors : bool -> FileInfo
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:
FileInfoA
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