Subject: Re: bin/5283: cp -f does not work as expected
To: None <gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 04/11/1998 20:37:49
> The manual page for cp(1) in 1.3.1 claims that with the -f option:

> 1) each existing destination pathname is removed and a new file is
>    created, without prompting for confirmation

> The right behaviour for -f would be to try to remove the destination
> file if it cannot be opened for writing and to proceed [...]

"right" according to what?  According to the man page snippet you
quoted, the destination file should *always* be removed, whether or not
an open attempt succeeds (or would succeed) - this implies breaking
hard links, for example.  The manpage should be changed to describe the
actual behavior in any case, unless of course the code is changed to
match the docs....

Do any other OS's cps support -f?  Which semantics do they do?

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B