The -H, -L and -P options are ignored unless the -R option is
specified. In addition, these options override each other and the
command's actions are determined by the last one specified.
Add:
The default is as if the -P option had been specified.
- bump the manpage's date (because of the next change);
- note that cp(1) does not preserve hard links (even with `-R'),
and refer to pax(1) there as well as in the `SEE ALSO' section
for such functionality (this change is based upon a similar note
in FreeBSD's version of the manpage);
- change a wording, for more overall consistency.
"-R" claims:
-R [...] Created directories have the same mode as the corre-
sponding source directory, unmodified
by the process' umask.
Make this actually true.
In addition, make '-P' (no symbolic links are followed) apply even if
'-R' is not specified. This allows users to overwrite symbolic links
with files and/or to copy symbolic links over a file without indirecting
through the link (ie a copy of a link turns the target into a link, not
a copy of the file pointed to by the source).
It's suppsed to remove the file and then copy, which it wasn't doing.
But no wait, it turns out that the described behaviour in the manual doesn't
agree with POSIX. So we change the above fix and the manual to "try copy, and
if fail, try remove, then copy".
Fix bug where "cp -R" didn't work on read-only directories:
It would make the directory, set the mode, and not be able to write files into it.
Don't bother mmap()ing files of zero length. Was a workaround for a bug in Rhapsody
mmap(), which didn't get along with such files, but makes sense anyway.
Fix race condition where "cp -p" would set the mod time of a file before close()ing
the file, which would update the mod time and therefore screw up the "-p" idea,
except, of course, while running in gdb, which sucked.
Add -f option to usage message in binary and man page. Already documented in man page.
are distinct (See POSIX.2 glossary).
A utility is a executable, script or shell builtin; while a command
can be any of those things plus lists, pipelines, compound commands
(if, for, while) and shell function definitions.