bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug in ls v5.97


From: Eric Blake
Subject: Re: Bug in ls v5.97
Date: Sat, 13 Oct 2007 09:38:20 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

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

According to Антон Сергеевич on 10/13/2007 9:13 AM:
> First of all, sorry for my english... (
> I found strange bug in ls. When using long listing format ("ls -l")
> utility shows wrong total files count:
> 
> address@hidden:~/bot/infa$ ls -l
> total 100

Not a bug.  Rather than listing the number of files, what ls is really
listing is the number of file system blocks occupied by the files in that
directory (and some files occupy more than one block).

This is required by POSIX:
http://www.opengroup.org/onlinepubs/009695399/utilities/ls.html

| If any of the -l, -g, -n, -o, or -s options is specified,
| each list of files within the directory shall be preceded
| by a status line indicating the number of file system
| blocks occupied by files in the directory in 512-byte
| units, rounded up to the next integral number of units,
| if necessary. In the POSIX locale, the format shall be:
|
| "total %u\n", <number of units in the directory>

Although coreutils takes the approach of 1024-byte units unless you used
- --block-size, or if POSIXLY_CORRECT or BLOCK_SIZE is set in the
environment.  See 'info coreutils "block size"'.

> address@hidden:~$ uname -a
> Linux shtopor 2.6.22.6-shif #1 Sun Sep 16 15:24:33 MSD 2007 i686 GNU/Linux
> *
> coreutils version -- 5.97-5.3.

You may want to consider upgrading.  The latest stable version of
coreutils is 6.9.

- --
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

iD8DBQFHEOZr84KuGfSFAYARApLVAJ9JTz0OZDFRV9BZV2sBSe9ZN9TyQACfaDKV
WcdsS5gJ2kbHQk4mTGJ3GmE=
=vvBB
-----END PGP SIGNATURE-----




reply via email to

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