bug-coreutils
[Top][All Lists]
Advanced

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

bug#56710: ls vs. stat display of st_size


From: Paul Eggert
Subject: bug#56710: ls vs. stat display of st_size
Date: Sat, 23 Jul 2022 13:07:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 7/23/22 05:17, Pádraig Brady wrote:

BTW I see we've code in cache_fstatat() that assumes
st_size can't have such large values, which contradicts a bit.

Good catch. I installed the first attached patch.


> This is only a real consideration for virtual files I think
> since off_t is signed, and so impractical for a real file system
> to support files > OFF_T_MAX.

Yes, that sounds right.

You've convinced me that 'ls' should switch to the way 'stat' behaves rather than vice versa; that's more useful anyway. How about the attached second patch, which I haven't installed? (I was actually inclined this way originally but got lazy.)

Attachment: 0001-rm-don-t-assume-st_size-is-nonnegative.patch
Description: Text Data

Attachment: 0002-ls-print-negative-file-sizes-as-negative.patch
Description: Text Data


reply via email to

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