all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Matthew Newton <matt@mnewton.com>
Cc: 33757@debbugs.gnu.org
Subject: bug#33757: 27.0.50; dired-du-mode displays incorrect human readable file sizes for non-GNU systems
Date: Sat, 15 Dec 2018 10:52:31 +0100	[thread overview]
Message-ID: <m2k1kbce1s.fsf@gmail.com> (raw)
In-Reply-To: <133EC18A-49D2-4665-9E31-ED25CDD8A7EF@mnewton.com> (Matthew Newton's message of "Fri, 14 Dec 2018 22:37:33 -0800")

Matthew Newton <matt@mnewton.com> writes:

> * Reproduction
> 1. Run MacOS (Or I suspect any OS that is not GNU-based).
> 2. emacs -Q
> 3. M-x package-install RET dired-du RET
> 4. M-x dired RET ~ RET
> 5. M-x dired-du-mode RET
> 6. Notice that file sizes are displayed in kbytes, not bytes (they are displayed in bytes in a GNU-based system)
> 7. M-x dired-du--toggle-human-readable RET
> 8. M-x z z (to enable file sizes displated in human readable form, i.e. sizes ending in k, M, G, T)
> 9. File sizes displayed are one order of magnitude smaller than their
> actual size (e.g. if the file size is 2MB then it will be displayed as
> 2kB)
>
> * Discussion
> The problem seems to arise when the custom variable
> dired-du-used-space-program is set. For a GNU-based system, it gets
> set to "du -sb" but for MacOS it gets set to "du -sk". Then later when
> the human readable sizes are calculated, this difference does not
> appear to be accounted for.
>
> Why do we make the distinction between a GNU-based system and anything
> else? Can we just change the logic setting dired-du-used-space-program
> to always run "du -sb”?
>

$ uname -a
Darwin rpluim-mac 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
$ du -sb
du: illegal option -- b
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g]
[-x] [-I mask] [file ...]

IOW the fix will have to be in dired-du.

Robert





  reply	other threads:[~2018-12-15  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  6:37 bug#33757: 27.0.50; dired-du-mode displays incorrect human readable file sizes for non-GNU systems Matthew Newton
2018-12-15  9:52 ` Robert Pluim [this message]
2018-12-15 18:13   ` Matthew Newton

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=m2k1kbce1s.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=33757@debbugs.gnu.org \
    --cc=matt@mnewton.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.