mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] commands: ls: use 14 digits for filesize
@ 2015-10-02  4:56 Antony Pavlov
  2015-10-02  7:16 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2015-10-02  4:56 UTC (permalink / raw)
  To: barebox

10 digits are not enough for modern SATA/USB storages. E.g.:

    barebox> ls -l /dev/
    cr-------- 500107862016 ata0
    cr--------   33554432 ata0.0
    cr-------- 500073258496 ata0.1
    cr-------- 32224837632 disk0
    cr--------   67108864 disk0.0
    cr-------- 32156680192 disk0.1

14 digits look much better. E.g.:

    barebox> ls -l /dev/
    cr--------   500107862016 ata0
    cr--------       33554432 ata0.0
    cr--------   500073258496 ata0.1
    cr--------    32224837632 disk0
    cr--------       67108864 disk0.0
    cr--------    32156680192 disk0.1

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 commands/ls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/ls.c b/commands/ls.c
index 1a5925d..09437af 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -32,7 +32,7 @@ static void ls_one(const char *path, const char* fullname, struct stat *s)
 	unsigned int namelen = strlen(path);
 
 	mkmodestr(s->st_mode, modestr);
-	printf("%s %10llu %*.*s", modestr, s->st_size, namelen, namelen, path);
+	printf("%s %14llu %*.*s", modestr, s->st_size, namelen, namelen, path);
 
 	if (S_ISLNK(s->st_mode)) {
 		char realname[PATH_MAX];
-- 
2.6.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] commands: ls: use 14 digits for filesize
  2015-10-02  4:56 [PATCH] commands: ls: use 14 digits for filesize Antony Pavlov
@ 2015-10-02  7:16 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-10-02  7:16 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Fri, Oct 02, 2015 at 07:56:51AM +0300, Antony Pavlov wrote:
> 10 digits are not enough for modern SATA/USB storages. E.g.:
> 
>     barebox> ls -l /dev/
>     cr-------- 500107862016 ata0
>     cr--------   33554432 ata0.0
>     cr-------- 500073258496 ata0.1
>     cr-------- 32224837632 disk0
>     cr--------   67108864 disk0.0
>     cr-------- 32156680192 disk0.1
> 
> 14 digits look much better. E.g.:
> 
>     barebox> ls -l /dev/
>     cr--------   500107862016 ata0
>     cr--------       33554432 ata0.0
>     cr--------   500073258496 ata0.1
>     cr--------    32224837632 disk0
>     cr--------       67108864 disk0.0
>     cr--------    32156680192 disk0.1
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  commands/ls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/commands/ls.c b/commands/ls.c
> index 1a5925d..09437af 100644
> --- a/commands/ls.c
> +++ b/commands/ls.c
> @@ -32,7 +32,7 @@ static void ls_one(const char *path, const char* fullname, struct stat *s)
>  	unsigned int namelen = strlen(path);
>  
>  	mkmodestr(s->st_mode, modestr);
> -	printf("%s %10llu %*.*s", modestr, s->st_size, namelen, namelen, path);
> +	printf("%s %14llu %*.*s", modestr, s->st_size, namelen, namelen, path);

Maybe we should autogenerate that number from the current compile year
taking Moores law into account ;)

Until that is done: Applied this one

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-02  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02  4:56 [PATCH] commands: ls: use 14 digits for filesize Antony Pavlov
2015-10-02  7:16 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox