os.Path.copy

The os.Path.copy function copies an existing file to create a new one. The syntax of the method is as follows:

 

CALL os.Path.copy(source_file, dest) RETURNING result

 

where:

·         source_file = a string containing the path name to the file to copy,

·         dest = a string containing the destination and the name of the newly created (copied) file,

·         result = TRUE when the file has been copied successfully or FALSE otherwise.

 

Here is an example of the os.Path.copy method calling:

 

#copies the file "file_1.txt" from " C:\New folder" to " C:\" with the same name

CALL os.Path.copy("C:\\Files\\file_1.txt", "C:\\file_1.txt") RETURNING result1

 

#copies the file "file_1" from " C:\New folder" to " C:\" with the name changed to 'file_2.txt'

CALLos.Path.copy("C:\\Files\\file_1.txt", "C:\\file_2.txt") RETURNING result2