!OSCOPY

!OSCOPY

Top  Previous  Next

 

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

 

src.pathis the pathname of the file or directory to be copied.

 

tgt.pathis the pathname of destination.

 

no.queryis a Boolean value that determines whether a query prompt is displayed to confirm that the target directory is to be created. This argument is optional and defaults to True.

 

flushis a Boolean value that determines whether the file cache should be flushed prior to the copy. This argument is optional and defaults to True. See FLUSH.DH.CACHE for more information.

 

appendis a Boolean value that ,if True, causes !OSCOPY() to append to tgt.path if src.path is a file that already exists.

 

 

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:

OSCOPY