Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 2014 11:40:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 191974] ln(1): |ln -sF| never calls rmdir(2) on target_file == target_dir, only target_dir/basename
Message-ID:  <bug-191974-8-ZxaImPX7iR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-191974-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-191974-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191974

--- Comment #4 from Jan Beich <jbeich@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191974-8-ZxaImPX7iR>