FileOps.$copy()

Function group Execute on client Platform(s)
FileOps NO All

Syntax

FileOps.$copy(cFromPath,cToPath[,bCreatePath=kFalse,bReplace=kFalse,bMerge=kFalse]) )

Description

Copies the file or folder specified in cFromPath to cToPath.

If bCreatePath is kTrue, $copy will automatically create any missing folders in the path specified by the pToPath parameter.

When bMerge is kTrue, and the destination is a file, the contents of the source file are appended to it. If the destination is a folder, the files and subfolders from the source are merged with those in the destination.

If bReplace is kTrue, the destination file or folder is deleted before the source is copied.

When bReplace and bMerge are both kTrue, and the destination is a file, replace takes precedence over merge, meaning the destination file is removed before the source is copied. If the destination is a folder, merging occurs, but existing files in the destination are overwritten by those from the source.

Note: for destination folders that do not exist to be recognized as folders, they must end in the platform-specific filepath separator, otherwise they will be interpreted as files.

To move a file or folder, rather than copy it, use $move().