bug-coreutils
[Top][All Lists]
Advanced

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

bug#48960: stat v8.30 - device number in decimal shown as 16bit number i


From: Pádraig Brady
Subject: 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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0

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

Attachment: stat-device-formats.diff
Description: Text Data


reply via email to

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