FileOps.$copyfile()

Function groupExecute on clientPlatform(s)
FileOpsNOAll

Syntax

FileOps.$copyfile(cFromPath,cToPath)

Description

Deprecated: copies the file specified in cFromPath to the file cToPath.The file named in cToPath must not already exist.

cToPath is the path to destination folder into which the file will be copied (if you include a file name in the cToPath the function will fail under macOS); 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().

Example

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