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




Copies the file specified in cFromPath to the file cToPath. The file named in cToPath must not already exist. Pathnames can be over 255 characters, which was the limit in Studio 8.0.1 or earlier.

cToPath is the path to destination folder into which the file will be copied; the file to be copied must not already exist in the destination folder.

The function returns an error code, or zero if successful: see the FileOps function error codes.

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


Do FileOps.$copyfile('c:\omnis\test.txt','c:\examples\test.txt') Returns lError
; copies 'test.txt' to the 'examples' folder

Do FileOps.$copyfile('c:\omnis\test.txt','c:\examples\test2.txt') Returns lError
; copies 'test.txt' to 'test2.txt' in the 'examples' folder

Do FileOps.$copyfile('c:\omnis\test.txt','c:\omnis\test2.txt') Returns lError
; copies 'test.txt' to 'test2.txt' in the same folder