GNU bug report logs - #48960
stat v8.30 - device number in decimal shown as 16bit number instead of to converted 8bit

Previous Next

Package: coreutils;

Reported by: wolfgang.rohm <at> arcor.de

Date: Fri, 11 Jun 2021 14:58:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 48960 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, wolfgang.rohm <at> arcor.de,
 48960 <at> debbugs.gnu.org
Subject: Re: bug#48960: stat v8.30 - device number in decimal shown as 16bit
 number instead of to converted 8bit
Date: Sun, 20 Jun 2021 15:21:54 +0100
[Message part 1 (text/plain, inline)]
On 12/06/2021 16:19, Pádraig Brady wrote:
> We could take the FreeBSD approach which is:
> 
>     %Hd  major device number in decimal (st_dev)
>     %Ld  minor device number in decimal (st_dev)
>     %Hr  major device type in decimal (st_rdev)
>     %Lr  minor device type in decimal (st_rdev)
> 
> Note I'd be inclined to not have a space between major,minor in default stat output,
> as there should be no ambiguity with locale formatted numbers, which could be
> the case with ls. For example, my ls alias uses thousands grouping with:
> alias ls="BLOCK_SIZE=\'1 ls --color=auto".
> I.e. the default format would from stat would be
> Device: %Hd,%Ld  ..... Device type: %Hr,%Lr
> 
> For consistency if we provided the above we should also probably provide:
> 
>    %r     (composed) device type in decimal (st_rdev)
>    %R     (composed) device type in hex (st_rdev)

The attached adds the new formats.
I'll follow up with another to adjust the default output accordingly.

cheers,
Pádraig
[stat-device-formats.diff (text/x-patch, attachment)]

This bug report was last modified 3 years and 340 days ago.

Previous Next


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