FileCopy Procedure

Version 6

 

Copies an existing file to a new file.

Syntax

[ bRet = ] FileCopy ( sExistingFileName, sNewFileName [,bFailIfExists] )

The FileCopy procedure syntax has the following parts:

 

Name

Type

Description

bRet

Bool

True if successful, False for failure

sExistingFileName

Val BString

Name of existing file

sNewFileName

Val BString

New file name

bFailIfExists

Val Bool

Specifies how this operation is to proceed if a file of the same name as that specified by sNewFileName already exists. See below for more comments. Default is true.

Comments

If the parameter 'bFailIfExists' is TRUE and the new file 'sNewFileName' already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.

Example

The following example copies the file:

FileCopy("C:\\LogFiles\\TestExec\\A.log","C:\\LogFiles\\TestExec\\Backup\\A.log")

See Also

FileRemove, FileCreate, FileRename