[Bug 191974] ln(1): |ln -sF| never calls rmdir(2) on target_file == target_dir, only target_dir/basename

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 21 11:40:07 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191974

--- Comment #4 from Jan Beich <jbeich at vfemail.net> ---
Created attachment 144837
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=144837&action=edit
improve manpage

-f flag can replace a file with either symlink to file or directory and
hardlink to file. -f already errors out if source_file is a directory and -F
inherits that. But comment 3 still doesn't explain *why* -F is artifically
limited to symlinks and only directories or behavior inconsistency if
target_file is a directory.

hadlink case

  $ echo >foo
  $ echo >bar
  $ ln -F foo bar

vs.

  $ echo >foo
  $ mkdir bar
  $ ln -F foo bar

symlink case

  $ echo >foo
  $ echo >bar
  $ ln -sF foo bar

  $ mkdir foo
  $ echo >bar
  $ ln -sF foo bar

vs.

  $ mkdir foo
  $ mkdir bar
  $ ln -sF foo bar

  $ echo >foo
  $ mkdir bar
  $ ln -sF foo bar

Let's remove some ambiguity in manpage such as when target file is a directory.
Given current behavior its notion doesn't change from target directory and
rmdir(2) is only called under it but not on the directory itself.

Also, -F is not only an extension but incompatible with GNU ln.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list