Script functions reference > Script functions in alphabetical order > F > FileCopy

FileCopy
Syntax
FileCopy(sourcefile, dest_file);
sourcefile 
dest_file 
Description
Copies the specified file, and leaves the original file unchanged. See also IoErrText.
Returns
A number indicating whether the file was successfully copied.
0
>0
Failure. This value can be sent to IoErrText which will return an error text for the failure.
Example
//Copy the contents of myfile.txt to mycopy.txt 
//and store the returned value in $err
 
$err = filecopy("myfile.txt", "mycopy.txt");
 
//If the action was unsuccessful, pass the error value
//to ioerrtext and store the error text returned by
//ioerrtext in $errtext.
//Send the error text to the log file
 
if(num($err)!=0)
{
$errtext=ioerrtext($err);
log(0,"Errortext "+$errtext);
}
OpenText StreamServe 5.6 Updated: 2013-03-01