Replace()

FileInfo::Replace(const String&, const String&) method

Replaces the contents of a specified destination file with the file represented by the current FileInfo object and creates a backup of the replaced file.

FileInfoPtr System::IO::FileInfo::Replace(const String &destinationFileName, const String &destinationBackupFileName)

Arguments

ParameterTypeDescription
destinationFileNameconst String&A name of the file to replace
destinationBackupFileNameconst String&A name of the backup file

Return Value

A FileInfor object that represents the file pointed to by destinationFileName

FileInfo::Replace(const String&, const String&, bool) method

Replaces the contents of a specified destination file with the file represented by the current FileInfo object and creates a backup of the replaced file.

FileInfoPtr System::IO::FileInfo::Replace(const String &destinationFileName, const String &destinationBackupFileName, bool ignoreMetadataErrors)

Arguments

ParameterTypeDescription
destinationFileNameconst String&A name of the file to replace
destinationBackupFileNameconst String&A name of the backup file
ignoreMetadataErrorsboolSpecifies if the merge errors from the replaced file to the replacement file should be ignored (true) or not (false)

Return Value

A FileInfor object that represents the file pointed to by destinationFileName

See Also