From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 3 18:15:39 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EFD11065670 for ; Tue, 3 Mar 2009 18:15:39 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id CACC68FC17 for ; Tue, 3 Mar 2009 18:15:38 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA13723 for ; Tue, 03 Mar 2009 20:15:36 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49AD73C8.7010500@icyb.net.ua> Date: Tue, 03 Mar 2009 20:15:36 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: ln: posixly confused X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2009 18:15:42 -0000 Test case. Preparation: $ mkdir linktest $ cd linktest $ mkdir some_dir $ mkdir other_dir The test: $ ln -s some_dir the_link $ ln -s -f other_dir the_link Expected: the_link points to other_dir. Actual result: some_dir contains symlink other_dir -> other_dir. >From ln(1): SYNOPSIS ln [-s [-F]] [-f | -iw] [-hnv] source_file [target_file] ln [-s [-F]] [-f | -iw] [-hnv] source_file ... target_dir I thought that only true directory would trigger the second form. I thought that the second argument being a symlink (to a file or to a directory) should trigger the first form. I also read this: http://www.opengroup.org/onlinepubs/009695399/utilities/ln.html I think that the text there (and in ln(1)) implies what I expected, but this is not spelled out clearly. I am confused. -- Andriy Gapon