GNU bug report logs - #56710
ls vs. stat display of st_size

Previous Next

Package: coreutils;

Reported by: Andreas Schwab <schwab <at> linux-m68k.org>

Date: Fri, 22 Jul 2022 20:10:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 56710 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: bug#56710: ls vs. stat display of st_size
Date: Sat, 23 Jul 2022 13:07:28 -0700
[Message part 1 (text/plain, inline)]
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.)
[0001-rm-don-t-assume-st_size-is-nonnegative.patch (text/x-patch, attachment)]
[0002-ls-print-negative-file-sizes-as-negative.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.