Shell Commands/Copy

From MorphOS Library

< Shell Commands

Copy - Copies a source file or directory to another directory

FROM/M, TO, PAT=PATTERN/K, BUF=BUFFER/K/N, ALL/S, DIRECT/S, CLONE/S, DATES/S, NOPRO/S, PROX/S, COM=COMMENT/S, QUIET/S, NOREQ/S, ERRWARN/S, MAKEDIR/S, MOVE/S, DELETE/S, HARD=HARDLINK/S, SOFT=SOFTLINK/S, FOLNK=FORCELINK/S, FODEL=FORCEDELETE/S, FOOVR=FORCEOVERWRITE/S,DONTOVR=DONTOVERWRITE/S,FORCE/S

FROM    - files or directory to copy.                                                
TO      - destination path-name or file
PATTERN - when FROM is a directory, only files matching this pattern
          will be copied.
BUFFER  - size of the buffer (multiple of 512 bytes)to use during the copy
ALL     - includes sub-directories if FROM is a directory
DIRECT  - copy file without any tests or options
CLONE   - keeps timestamp, comments, and protec. bits of the FROM file.
DATES   - the timestamp of the FROM file is copied to the TO file.
NOPRO   - The protection bits of the FROM file are not copied
          to the TO file. The TO file is given standard protection bits
          or r, w, e, and d.
PROX    - only copy X,S,P protection bits
COMMENT - the comments of the FROM file are copied to the TO file.
QUIET   - suppresses output messages/errors and requesters.
NOREQ   - errors such as disk full, or assign not existing will cause
          the display of a requester. Using this switch will remove them.
ERRWARN - do not proceed when one file failed.
MAKEDIR - produce directories.
MOVE    - delete source files after the copying successful.
DELETE  - do not copy but delete the source files.
HARD    - make a hardlink to source instead of copying.
SOFT    - make a sourcelink to source instead of copying.
FOLNK   - also makes links to directories.
FODEL   - delete protected files as well.
FOOVR   - also overwrites protected files.
DONTOVR - do not overwrite files if they already exist
FORCE   - DEPRECIATED: if files already exist and are write-protected,
          this option will force them to be overwritten

Copy copies the file or directory specified with the FROM argument to the file or directory specified by the TO argument. You can copy several items at once by giving more than one name/pattern in the FROM argument; they should be separated by spaces. If the FROM argument is a pattern or consists of multiple names, the TO argument must be a directory. If a TO file name already exists, Copy overwrites the TO file with the FROM file. You can use a pair of double quotation marks ("") to refer to the current directory. When used as the FROM argument, "" copies all the files in the current directory. Do not put any spaces between the double quotation marks.