[comp.unix.wizards] ln -f, corrections

djm@eng.umd.edu (David J. MacKenzie) (07/24/90)

In my last posting, I meant to say that the *SunOS* BSD ln -f allows
hard links to directories, and that POSIX ln always unlinks existing
destination files, unless -i is given, or the file is unwritable and
-f is not given, in which cases it prompts you to allow you to skip the
file.
--
David J. MacKenzie <djm@eng.umd.edu> <djm@ai.mit.edu>

les@chinet.chi.il.us (Leslie Mikesell) (08/01/90)

In article <3797@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:

>Which means the ultimate problem isn't that one behavior is "good" and the
>other is "bad", but that they're *different*.  Standardizing on either
>one would have worked (modulo windows opened by having to implement one
>behavior with multiple commands on a system that provides the other).

On systems without ln -f (where ln defaults to removing the target if
it already exists) another program is required to perform a link which
fails if the target exists.  On SysVr[23] on 3B2's, this program exists
as /etc/link:
-r-x------   1 root     bin         1716 Mar 3  1988 /etc/link
Thus, unless someone changes things there is no atomic file action
that can be used by an ordinary user in a shell script.  I'd call
that "bad".

Les Mikesell
  les@chinet.chi.il.us