CBL_COPY_FILE

CBL_COPY_FILE creates a copy of an existing file.

Usage

CALL "CBL_COPY_FILE" 
    USING SOURCE-FILE, DEST-FILE,
    GIVING COPY-STATUS

Parameters

SOURCE-FILE PIC X(n) Contains the name of the file to copy. The name can contain a path and is terminated by a space. If no path is given, the current directory is assumed. Remote name notation is allowed for this parameter.
DEST-FILE PIC X(n) Contains the destination file name. The name can contain a path and is terminated by a space. If no path is given, the current directory is assumed. Remote name notation is allowed for this parameter.
COPY-STATUS Any numeric type    Returns 0 if successful, or 1 if not.

Description

CBL_COPY_FILE creates an exact duplicate of SOURCE-FILE in DEST-FILE.

The behavior of this routine is affected by the FILENAME_SPACES configuration variable. The value of FILENAME_SPACES determines whether spaces are allowed in a file name. See the entry for FILENAME_SPACES in Appendix H for more information.

To transfer files between the application host and display host in a thin client environment, add the prefix "@[DISPLAY]:" to the name of any source or destination file that resides on the client machine. For example:

CBL_COPY_FILE "@[DISPLAY]:C:\path\file1.ext" "/usr/data/
file1.ext"

To copy from one path on the client to another, specify the "@[DISPLAY]:" prefix for both the SOURCE-FILE and the DEST-FILE.

If the file name on the client starts with special directory specifiers, the thin client attempts to locate those files in special Windows directories. The special directory names are as follows:

Identifier Directory
<APPDATA> C:\Documents and Settings\<user>\Application Data
<COMMON_APPDATA> C:\Documents and Settings\All Users\Application Data
<COMMON_DOCUMENTS> C:\Documents and Settings\All Users\Documents
<DESKTOP> C:\Documents and Settings\<user>\Desktop
<LOCAL_APPDATA> C:\Documents and Settings\<user>\Local Settings\Application Data
<MYDOCUMENTS> C:\Documents and Settings\<user>\My Documents

these directories are not necessarily the same for all versions of Windows, and may in fact be on network drives.

Note: THIS NOTE APPLIES TO C$CHDIR.To get the current default directory on the display host, DIR_NAME should contain "@[DISPLAY]:" followed by spaces."