contents.gifindex.gifprev1.gifnext1.gif

9.3.1 C$COPY

C$COPY creates an exact duplicate of SOURCE-FILE in DEST-FILE. The usage of C$COPY is:

CALL "C$COPY"

USING SOURCE-FILE, DEST-FILE, FILE-TYPE
GIVING COPY-STATUS

Remote name notation is permitted on both the SOURCE-FILE and the DEST-FILE parameter.

If either the SOURCE-FILE or DEST-FILE parameter specifies a remote file:

serv9000.gif The copy takes place on the specified machine.

serv9000.gif The location of the source and destination files on the server is dependent on the paths specified by SOURCE-FILE and DEST-FILE. Parameters that do not specify an absolute pathname (an absolute path starts with a "/"), are considered to be located relative to the directory in which the server (acuserve) was started. For example:

If acuserve was started on condor in the /acucobol directory, and SOURCE-FILE is:

@condor:index.dat

AcuServer expects to find index.dat in directory /acucobol (note the absence of a "/" after "condor:").

If SOURCE-FILE is:

@condor:/usr2/sales_records/index.dat

AcuServer expects to find index.dat in the absolute path /usr2/sales_records.

These pathing rules hold for both SOURCE-FILE and DEST-FILE.

FILE-PREFIX is not used to search for file names held in any of the function's parameters. Name aliases are not substituted for names held in the function's parameters. Full path names to the files, including remote name notation on the SOURCE-FILE and DEST-FILE, must be hard coded in the function call. A more portable solution is to use the ACCEPT FROM ENVIRONMENT statement to get pathnames during program execution. See Appendix H of the ACUCOBOL-85 and ACUCOBOL-GT documentation.

C$COPY returns a zero (0) if successful, a one (1) if the file does not exist or is not a regular disk file, or a two (2) if there is a network error (for example, AcuServer is not running). This value is returned to COPY-STATUS.

For a complete description of C$COPY, excluding the above restrictions, see Appendix I of the ACUCOBOL-85 and ACUCOBOL-GT documentation.