[Overview][Constants][Types][Classes][Procedures and functions][Index] |
Copies the source file to the destination file using the specified options.
Source position: fileutil.pas line 201
function CopyFile( |
const SrcFilename: string; |
const DestFilename: string; |
Flags: TCopyFileFlags = [cffOverwriteFile]; |
ExceptionOnError: Boolean = False |
):Boolean; |
const SrcFilename: string; |
const DestFilename: string; |
PreserveTime: Boolean; |
ExceptionOnError: Boolean = False |
):Boolean; |
SrcFilename |
|
The source file name for the copy operation. |
DestFilename |
|
The destination file name for the copy operation. |
Flags |
|
Set with flags enabled for the copy operation. |
ExceptionOnError |
|
If True, and exception is raised if the copy operation cannot be performed. |
Returns True if successful, False if there was an error.
SrcFilename |
|
The source file name for the copy operation. |
DestFilename |
|
The destination file name for the copy operation. |
PreserveTime |
|
If True, the timestamp of the original file is preserved in the copied file. |
ExceptionOnError |
|
If True, and exception is raised if the copy operation cannot be performed. |
CopyFile is an overloaded Boolean function used to copy the file in SrcFilename to the destination in DestFilename. Both parameters contain a fully-qualified path with file name and extension (if needed) for the respective files.
Flags contains TCopyFileFlag value(s) that are enforced in the copy operation. The default value for the parameter is [cffOverwriteFile] and indicates that the destination file is overwritten if it already exists on the local file system.
PreserveTime indicates if the timestamp for the source file is preserved in the destination file when the copy operation has been completed. It is an alternative to using the Flags arguments in the overloaded variant.
The return value is set to True when the copy operation has been completed successfully. Otherwise, the return value is False.
An Exception is raised if the copy process does not complete successfully or correctly.
Version 3.2 | Generated 2024-02-25 | Home |