*Conan The Librarian
1.$ COPY TEST.DAT NEWTEST.DAT In this example, the COPY command copies the contents of the file TEST.DAT from the default disk and directory to a file named NEWTEST.DAT on the same disk and directory. If a file named NEWTEST.DAT exists, the COPY command creates a new version of the file. 2.$ COPY ALPHA.TXT TMP $ COPY ALPHA.TXT .TMP In this example, the first COPY command copies the file ALPHA.TXT into a file named TMP.TXT. The COPY command uses the file type of the input file to complete the file specification for the output file. The second COPY command creates a file named ALPHA.TMP. The COPY command uses the file name of the input file to name the output file. 3.$ COPY *.* PRTLND::*.* In this example, the COPY command copies all files within the user directory at the local node to the remote node PRTLND. The new files have the same names as the input file. You must have write (W) access to the default directory on remote node PRTLND for the command to work. 4.$ COPY BOSTON::DISK2:TEST.DAT;5 _To: DALLAS"SAM SECReturn"::DISK0:[MODEL.TEST]TEST.DAT/ALLOCATION=50 In this example, the COPY command copies the file TEST.DAT;5 on the device DISK2 at node BOSTON to a new file named TEST.DAT at remote node DALLAS. The /ALLOCATION qualifier initially allocates 50 blocks for the new file TEST.DAT at node DALLAS. The access control string SAM SECReturn is used to access the remote directory. 5.$ COPY [SMITH]MONKEY.DIR [PAINTER] $ COPY [SMITH.MONKEY]*.* [PAINTER.MONKEY]*.* In this example, the COPY command creates the new empty directory [PAINTER.MONKEY] that is registered in the [PAINTER]MONKEY.DIR directory file. After the COPY command creates the new [PAINTER]MONKEY.DIR directory file, you can copy or create files in the [PAINTER.MONKEY] directory. The second COPY command in this example copies files from the [SMITH.MONKEY] directory to the [PAINTER.MONKEY] directory. 6.$ COPY [SMITH]CATS.DIR [SMITH]DOGS.DIR In this example, the COPY command creates the new empty directory file, called [SMITH]DOGS.DIR. Use this copy command to create a directory file that has the same attributes as the [SMITH]CATS.DIR file. This command example has the same effect as entering the command: $ CREATE/DIRECTORY [SMITH.DOGS] 7.$ COPY [SMITH]TIGER.DIR [SMITH.ANIMALS] $ COPY [SMITH.TIGER]*.* [SMITH.ANIMALS.TIGER]*.* $ DELETE [SMITH.TIGER]*.*;* $ SET PROTECTION=W=D TIGER.DIR $ DELETE TIGER.DIR; In this example, the COPY command creates the new empty directory file called [SMITH.ANIMALS]TIGER.DIR. The subsequent commands in this example then copy the files from the [SMITH.TIGER] directory to the [SMITH.ANIMALS.TIGER] directory, then delete the original TIGER.DIR directory file. Because the TIGER.DIR is a directory file, you must specify a protection code of delete (D) before you can delete the directory file.