AmigaOS 4.0 - About OS4 - Commands
|
||||||||||
|
||||||||||
|
COPY copies the file(s) or directory(s) specified with the FROM argument to the file or
directory specified by the TO argument. You can copy several files at once by giving more than
one FROM argument; each argument should be separated by spaces. You can use pattern matching to
copy or exclude items whose names share a common set of characters or symbols.
If a TO filename already exists, COPY overwrites the TO file with the FROM file except when the NOREP or NOREPLACE option has been specified, or the NEWER option has been specified and the creation or last revised date (whichever is most recent) of the FROM file is earlier than the TO file. If you name a destination directory that does not exist, COPY will fail with an 'object not found' error. If you do not specify a directory, it will default to the current directory. If you use a pair of double quotes ("") as the destination, it will default to the current directory using the same name as the FROM file - of course this is only logical if the FROM file is in a different directory. If the FROM argument is a directory, only the directory's files will be copied; its sub-directories will not be copied. Use the ALL option to copy the complete directory, including its files, sub-directories and the sub-directories' files. If you want to copy a directory and you want the copy to have the same name as the original, you must include the directory name in the TO argument. COPY displays to the screen the name of each file as it is copied. This can be overridden by the Q or QUIET option. The BUF or BUFFER option is used to set the number of 512-byte buffers used during the copy. (The default is 200 buffers, approximately 100K of RAM.) It is often useful to limit the number of buffers when copying to RAM:. BUF 0 or BUFFER 0 uses a buffer the same size as the file to be copied. Normally, COPY gives the TO file the date and time the copy was made, rather than the date and time the file was created or last revised. Any comments attached to the original FROM file are ignored. However, the protection bits of the FROM file are copied to the TO file. The protection bits of the FROM file are not altered. Several options allow you to override these defaults:
Normally COPY displays a requester if the copy cannot continue for some reason. When the NOREQ or NOREQUESTERS option is given, all requesters are suppressed. This is useful in scripts and can prevent a COPY failure from stopping the script while it waits for a response. For example, if a script calls for a certain file to be copied and the system cannot find that file, normally the script would display a requester and would wait until a response was given. With the NOREQ or the NOREQUESTERS option, the COPY command would be aborted and the script would continue. The INTER or INTERACTIVE option checks if the destination file already exists. In this is the case, you will be prompted to confirm whether you want the file to be overwritten (answer 'y' for 'yes'). The FORCE option can be used when the destination file cannot be created because there is already a file with the same name that is protected against deletion or writing, in which case the protection will be removed first before the destination file is created. The COPYLINKS option specifies that COPY should copy the contents of a file referenced by a hard or soft link. The default is to skip copying linked files. The FOLLOWLINKS option specifies that COPY should follow hard and soft links to directories. The default is to skip links to directories. Example 1: Example 2: Example 3: Example 4: Example 5:
Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it. |