mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH] commands: ls: use 14 digits for filesize
Date: Fri,  2 Oct 2015 07:56:51 +0300	[thread overview]
Message-ID: <1443761811-15621-1-git-send-email-antonynpavlov@gmail.com> (raw)

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

             reply	other threads:[~2015-10-02  4:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  4:56 Antony Pavlov [this message]
2015-10-02  7:16 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443761811-15621-1-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox