ln -f, POSIX requirements

David J. MacKenzie djm at eng.umd.edu
Tue Jul 24 06:52:48 AEST 1990


POSIX.2 draft 9 requires that ln unlink unwritable existing
destination files before linking; it also requires a -i option to ask
first, and an -f option to unlink all existing destination files
before linking.  All of this was designed to make ln more consistent
with mv and cp.

The BSD ln's -f option has a completely different meaning -- allow
hard links to directories (what started this discussion), but only for
the superuser.  The SunOS 4.1 "System V" ln command has -f with the
POSIX meaning (almost -- it also suppresses error messages) and -F
with the BSD meaning.  The GNU ln follows POSIX, and has -d to allow
hard links to directories for the superusr, but I'm going to add -F as
a synonym for Sun compatibility in the next release.

--
David J. MacKenzie <djm at eng.umd.edu> <djm at ai.mit.edu>



More information about the Comp.unix.wizards mailing list