C$COPY

C$COPY creates a copy of an existing file.

Usage

CALL "C$COPY" 
    USING SOURCE-FILE, DEST-FILE, FILE-TYPE, 
    GIVING COPY-STATUS

Parameters

SOURCE-FILE PIC X(n) Contains the name of the file to copy. Remote name notation and "@[DISPLAY]:" notation are allowed for this parameter.

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

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

DEST-FILE PIC X(n) Contains the destination file name. Remote name notation and "@[DISPLAY]:" notation are allowed for this parameter.
FILE-TYPE PIC X (optional) Indicates the file type. If the FILE-TYPE parameter is supplied, it must be either "S", "R", "I", or "T", indicating that the source file is a sequential, relative, indexed file, or text file. Note that the "T" implies that the file is a line sequential file, since copying relative or indexed files as text is counter-intuitive and would likely corrupt those types of files. Copying text files applies when copying between UNIX and Windows systems, where text files have different line terminator characters.

The FILE-TYPE parameter can be useful in cases where the original file is held in more than one physical disk file (for example, C-ISAM indexed files are physically held in two separate files). If the FILE-TYPE parameter is omitted, then only the single physical file named in SOURCE-FILE is copied.

COPY-STATUS Any numeric type    Returns zero if successful, or non-zero if not. Currently, an unsuccessful status code is always 1, but future versions may return additional information.

Description

C$COPY 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.

C$COPY "@[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 you use the "@[DISPLAY]:" prefix, you may not use the FILE-TYPE parameter. Only the single, specified source file is copied.

See the AcuConnect User's Guide for more information about using C$COPY in a thin client environment.