[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'FileUtil' (#lcl)

# CopyFile

CopyFile - copies Source file to Destination file, optionally preserving the time stamp of the original file

## Declaration

Source position: line 0

`function CopyFile(`
`const SrcFilename: String;`
`const DestFilename: String`
`):Boolean; function CopyFile(`
`const SrcFilename: String;`
`const DestFilename: String;`
`PreserveTime: Boolean`
`):Boolean;`

## Arguments

`SrcFilename` |  | The source filename for the Copy
`DestFilename` |  | The destination filename for the Copy

## Function result

Returns True if successful, False if there was an error

## Arguments

`SrcFilename` |  | The source filename for the Copy
`DestFilename` |  | The destination filename for the Copy
`PreserveTime` |  | If True, the time stamp of the original file is preserved in the copied file

## Function result

Returns True if successful, False if there was an error

## Errors

An exception is raised if the Copy process does not complete successfully or correctly

The latest version of this document can be found at lazarus-ccr.sourceforge.net .