COPYFILE Function

Copies a file.

Category: External File
Returned data type: Integer
Note: The returned value is a Boolean value where 1= success and 0 = error.

Syntax

COPYFILE(<source_file, target_file>)

Required Arguments

source_file

a string representing the name of the file to be copied; this can be specified as a fixed string, field name, or expression.

target_file

a string representing the name of the file to be written; this can be specified as a fixed string, field name, or expression.

Details

The COPYFILE function copies a file. If the target file exists, the COPYFILE function overwrites the target file.

Example

string source_file
string target_file
boolean rc_ok
 
source_file="C:\mydata.txt"
target_file="C:\mydata_copy.txt"
 
rc_ok = copyfile(source_file, target_file)