!OSCOPY |
|
|
The !OSCOPY() subroutine copies an operating system level file or directory to a specified location.
Format
CALL !OSCOPY(src.path, tgt.path {, no.query {, flush {, append}}})
where
The !OSCOPY() subroutine provides an easy way to copy an operating system file or directory.
In all cases, tgt.path is the pathname of the new file or directory, not the parent directory into which items will be copied.
The !OSCOPY() function locks each item as it progresses. When copying a QM hashed file, it is essential that the file is not open in any QM process as this may result in incorrect data being copied.
On return from !OSCOPY(), the STATUS() function with return zero if the copy was successful or an error code if the copy failed. Note that failure may occur at any stage of copying a directory structure and updates performed before the error will not be undone.
Example
CALL !OSCOPY("C:\SALES", "C:\BACKUPS\SALES", @TRUE)
The above program fragment copies C:\SALES (perhaps an operating system directory representing a QM hashed file) to a subdirectory of the same name under C:\BACKUPS. The third argument suppresses the prompt that would otherwise occur if the C:\BACKUPS directory does not exist.
See also: |