GNU bug report logs - #10281
du: hard-links counting with multiple arguments (commit

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 12 Dec 2011 18:02:02 UTC

Severity: wishlist

Tags: wontfix

Merged with 10282, 11526

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Elliott Forney <elliott.forney <at> gmail.com>
Cc: 10281 <at> debbugs.gnu.org
Subject: bug#10281: change in behavior of du with multiple arguments (commit efe53cc)
Date: Wed, 14 Dec 2011 11:03:03 -0800
On 12/13/11 12:25, Elliott Forney wrote:
> If I run "du -s a
> a/b" then there are in fact NOT two hard links to the same file (Linux
> doesn't even allow hard linked directories).

The intent of the POSIX spec is that files should be counted only once,
regardless of whether they are arrived at via hard links, or by following
symbolic links with -L, or by any other means.  One does not need to
appeal to hard-linked directories to run into the issue.  For example:

  $ mkdir d
  $ echo foo >f
  $ ln f d/f
  $ du d f
  2 d
  1 f

It's hard to argue that POSIX allows this behavior, even though it's what
Solaris 10 du does.

> the du implementations in Solaris, OSX and AIX
> (all of which are POSIX compliant)

No, I don't think they conform to POSIX in the above example.
Perhaps this is a bug in POSIX, of course, but there is a
good argument for why GNU du behaves the way it does: you get
useful behavior that you cannot get easily with the Solaris
du behavior.




This bug report was last modified 6 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.