Skip to content

CopyFile (copy a file)

ts
function CopyFile(what, toWhere: string): boolean;

This function copies the what file to the toWhere destination directory in the local file system, and returns true if the copy is successful, or false if the copy fails.

This function accepts the following parameters:

ParameterTypeRequirementExplanation
whatstringrequiredmust be a valid and existing file in a local file system
toWherestringrequireda valid and existing directory in a local file system where you want to copy the file to

Possible return values:

ValueExplanation
truethe function succeeded: the file was copied to the destination folder
truethe function failed: the file was not copied