Next: file commands move, Previous: file commands mkdir, Up: file commands [Contents][Index]
At present, copying of directories is not supported; we have to create the directory and then copy files into it.
Declare the commands required to copy files and directories. Declaring the intention to use a program
The programs are: cp
.
Copy the source, a file pathname, to target, a file pathname. Additional arguments are handed to the command unchanged.
If source does not exist, or if it is not a file, an error is generated and the return value is 1. If target exists an error is generated and the return value is 1.
Copy the source, a file pathname, into the directory target. Additional arguments are handed to the command unchanged.
If source does not exist, or if it is not a file, an error is generated and the return value is 1. If target does not exist or it is not a directory: an error message is generated and the return value is 1.
Next: file commands move, Previous: file commands mkdir, Up: file commands [Contents][Index]