bug-coreutils
[Top][All Lists]
Advanced

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

Re: Feature Request: du --dir-with-slash


From: Eric Blake
Subject: Re: Feature Request: du --dir-with-slash
Date: Fri, 07 Mar 2008 15:31:51 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Pádraig Brady on 3/7/2008 10:01 AM:
|
| So does that mean we should be stripping trailing /
| from directories that are specified?
|
| $ du -s /tmp////
| 8040    /tmp////
|
| I think adding a / to all dirs is therefore more consistent
| as well as providing more info to the user.

I think that it is more consistent to treat du like find, since both do
recursion, and here's what the POSIX folks had to say about find and
trailing slashes:
https://www.opengroup.org/austin/interps/uploads/40/14959/AI-186.txt

In short, if the trailing slash was present on the command line, it is
present in the output.  But when recursing, since readdir() does not add
trailing slashes, neither should the utility that is visiting files
recursively.  So only arguments given on the command line will end in slashes.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH0cJX84KuGfSFAYARAonaAJ436lvDb+EG69fCQ4bTeuXm7TCUpACgrpP6
UV2TGmte4DJXWjnXW0vBeLA=
=9CxU
-----END PGP SIGNATURE-----




reply via email to

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