ln -f, POSIX requirements

Dave Decot decot at hpisod2.HP.COM
Wed Aug 1 06:08:17 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.

This has changed dramatically in Draft 10:

   The -i option has been dropped.

   The default is to ask.

   The -f option prevents the asking and forces removal to allow the new link.

So, ln is no longer as consistent with cp and mv (or with the long-standing
SVID behavior).

Part of the rationale for this change is that "It is preferable that ln
perform in the same manner as the link() function, which does not permit
the target to already exist."

Cp and mv were changed in various other ways as well, so that none of
them are consistent with each other or ln in their default behavior
with respect to existing files.

Dave Decot



More information about the Comp.unix.wizards mailing list