[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10281: change in behavior of du with multiple arguments (commit efe5

From: Paul Eggert
Subject: bug#10281: change in behavior of du with multiple arguments (commit efe53cc)
Date: Wed, 14 Dec 2011 11:03:03 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]