VMS Help  —  COPY  Examples
    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 [JONES]
      $ COPY [SMITH.MONKEY]*.* [JONES.MONKEY]*.*

      In this example, the COPY command creates the new empty
      directory [JONES.MONKEY] that is registered in the
      [JONES]MONKEY.DIR directory file. After the COPY command
      creates the new [JONES]MONKEY.DIR directory file, you can copy
      or create files in the [JONES.MONKEY] directory.

      The second COPY command in this example copies files from the
      [SMITH.MONKEY] directory to the [JONES.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 SECURITY/PROTECTION=(WORLD:DELETE) 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
      TIGER.DIR is a directory file, you must specify a protection
      code of DELETE before you can delete the directory.
Close Help