Subject: bug#9939: Problems with the SIZE description in man pages for <ls>

From: "Alan Curry" <[email-masked]>
Date: Wed, 9 Nov 2011 17:48:39 -0500 (GMT+5)

abdallah clark writes:
> 
> I was wondering if you received my very detailed account of the issues
> I found with the <ls -l --block-size=3DSIZE> command. It's been about a
> week since I sent it, so I wasn't sure what was happening.

I looked over that message and prepared a reply explaining the things that
you had misunderstood. Then I tried running your examples and realized that I
didn't understand some of them either. According to my understanding, several
of the behaviors you observed are bugs. So I deleted my reply and decided to
wait along with you for someone else to explain it all.

Since that hasn't happened yet, I'll go ahead and cover the main point:

You're interested in altering the block size used in the ls output, but you
haven't investigated what portions of the output are affected by block size.
There are 3 instances of the word "block" in ls(1).

2 of them are in the description of the options that change the block size:
--block-size and -k.

The 3rd instance is under the only option that actually makes use of the
block size: -s.

A quick demonstration of -k working. First I have to set POSIXLY_CORRECT
because the default block size when not in POSIXLY_CORRECT mode is already
1K, so -k is normally a no-op.

$ POSIXLY_CORRECT=1 ; export POSIXLY_CORRECT
$ ls -s /bin/ls
224 /bin/ls
$ ls -sk /bin/ls
112 /bin/ls

Since the -l output is not defined in terms of block size, ls -l and ls -lk
will produce exactly the same output.

$ ls -l /bin/ls
-rwxr-xr-x 1 root root 107124 Feb  8  2011 /bin/ls
$ ls -lk /bin/ls
-rwxr-xr-x 1 root root 105 Feb  8  2011 /bin/ls

Oops.

Well, I know they used to produce the same output. And I think they still
should and this is a bug. Anyone?

> 
> On Wed, Nov 2, 2011 at 11:01 AM, Paul Eggert <[email-masked]> wrote:
[snip]
Quote what you're replying to, and put your reply in logical order with it.

-- 
Alan Curry