cp(1) question

Keith Bostic bostic at ucbvax.BERKELEY.EDU
Tue Jun 5 09:45:21 AEST 1990


An issue has come up recently concerning how cp in 4.4BSD should behave.
Historic cp's paid no attention to the type of the file being copied,
therefore, "cp /dev/rmt0 foo" tried to read from tape.  When the -r
option was added, no changes were made, so cp continued to treat special
files and symbolic links the same as before.

It has been argued recently that "cp -r" should treat special files,
including symbolic links, differently than the same files specified
explicitly on the command line.

We are considering changing cp's behavior so that when the -r option
is specified to cp, only directories and files have their contents
copied -- all special file types are recreated (if permissions allow).
This would make "cp -r" roughly equivalent to tar piped to tar.

The three issues are:

-- Should cp, when it encounters a special file in the course of its tree
   walk, either ignore the file or attempt to create a special file with
   the same characteristics as the file it found?

-- Should cp follow symbolic links by default, but create other special
   files as above when it finds one of these other special files?

-- Should cp be completely backward compatible, i.e. its behavior when
   copying file hierarchies remain unchanged?

Email to Keith Bostic (bostic at okeeffe.berkeley.edu, uunet!bostic).



More information about the Comp.unix.wizards mailing list