System::IO::FileInfo::CopyTo method

FileInfo::CopyTo(const String&) method

Copies the file represented by the current object to the specified location. If the destination file already exists, the copying fails.

FileInfoPtr System::IO::FileInfo::CopyTo(const String &destFileName)
ParameterTypeDescription
destFileNameconst String&The destination file name

ReturnValue

A FileInfo object that represents the copy

See Also

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

Copies the file represented by the current object to the specified location. A parameter specifies if existing destination file should be overwritten.

FileInfoPtr System::IO::FileInfo::CopyTo(const String &destFileName, bool overwrite)
ParameterTypeDescription
destFileNameconst String&The destination file name
overwriteboolTrue if the existing destination file should be overwritten, false if copying should fail if the destination file already exists

ReturnValue

A FileInfo object that represents the copy

See Also