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: Elliott Forney <idfah <at> cs.colostate.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 10281 <at> debbugs.gnu.org
Subject: bug#10281: change in behavior of du with multiple arguments (commit efe53cc)
Date: Fri, 16 Dec 2011 13:46:47 -0700
> 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.

I agree that symlinks and hard links and maybe even bind mounts or
whatever else should not be counted twice.  I do think, however, that
multiple command line arguments should be counted individually since
they were explicitly specified by the user.  At least by default.

My proposed solution would be the following:

By default, files with the same inode should only be counted once for
each command line argument.  This can already be overridden with
--count-links.  However, everything should be reset between command
line arguments so that multiple command line arguments are counted
individually.  As pointed out by Alan Curry, -c should be used to get
a correct total.

In addition to this, it would be nice if there were a command line
switch that allowed for files to only be counted once across all
command line arguments, i.e. a switch to enable the current behavior.

In this scheme, the GNU du retains compatibility with Solaris, AIX,
OSX, et cetra, but the user has the option to count multiple command
line arguments only once.  I do agree that this functionality can be
useful in some circumstances I just think it is a confusing default.

> No, I don't think they conform to POSIX in the above example.
> Perhaps this is a bug in POSIX

Of course, maybe the first thing to do is to get clarification on the
POSIX spec.




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.