directory copying with cp; broken?

Greyham Stoney greyham at ausonics.OZ
Fri Sep 16 12:48:10 AEST 1988


No doubt people have noticed this before, but to my way of thinking [and this
may well be the problem :-] cp on our BSD 4.2 system seems to be braindamaged.

When both the source and destination are directories, and the -r option is not
specified, the destination directory is left with a *file* by the name of the
source directory. Much the same as if
	cp sourcedir destdir
was really doing:
	cat sourcedir > destdir/sourcedir

I would have though cp intelligent enough to realise that source and dest were
directorys, and either do what the -r option does (so why do we need it?) or
just reject the copy. (depending on how you view these types of things)
Which ever solution, surely changing a directory into a regular file is a bit
inconsistent?.

		greyham at ausonics.oz
-- 
# Greyham Stoney:      (disclaimer not necessary: I'm obviously irresponsible)
# greyham at ausonics.oz - Ausonics Pty Ltd, Lane Cove. | greyham at utscsd.oz -
# ^^^^^^^       (Official Sponsor of this message.)  | Uni of Technology, Syd.
# [.signature changed to celebrate NEW LOGNAME!! ]   | Good Time City!!!



More information about the Comp.unix.wizards mailing list