From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <133EC18A-49D2-4665-9E31-ED25CDD8A7EF@mnewton.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544867475 3840 195.159.176.226 (15 Dec 2018 09:51:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Dec 2018 09:51:15 +0000 (UTC) Cc: 33757@debbugs.gnu.org To: Matthew Newton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 15 10:51:11 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY6bB-0000hs-81 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 10:51:05 +0100 Original-Received: from localhost ([::1]:38441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY6dH-0006pa-Hn for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 04:53:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY6d8-0006jU-90 for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 04:53:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY6d4-0002Vl-8h for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 04:53:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gY6d4-0002V6-46 for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 04:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gY6d3-0005rK-Tw for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 04:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Dec 2018 09:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33757-submit@debbugs.gnu.org id=B33757.154486756322494 (code B ref 33757); Sat, 15 Dec 2018 09:53:01 +0000 Original-Received: (at 33757) by debbugs.gnu.org; 15 Dec 2018 09:52:43 +0000 Original-Received: from localhost ([127.0.0.1]:48961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY6cl-0005qk-Bc for submit@debbugs.gnu.org; Sat, 15 Dec 2018 04:52:43 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:34969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY6cj-0005qX-6Z for 33757@debbugs.gnu.org; Sat, 15 Dec 2018 04:52:41 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id 96so7655203wrb.2 for <33757@debbugs.gnu.org>; Sat, 15 Dec 2018 01:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=7vRX9dHXGTzQ47vNXN04nmx53m3OY6q8nDLQsdzb2zM=; b=rlD/CwBBESd1hZbdRaZNAZqREPU9ZPUlutkAlIuDKEBCB6r0K89uvVfbJ0zsyeAtq+ yLJcDv2SBy/iW6nPgVIhg2E+M1Ku1ue6lnX/vDZaUDcbf5l8qy0TZycxVhy7ST+TvX0T DQRLanRjLtxS4ob1h3zW36+7gUFKE9Ael5VG6xgaijBgVxTncuDwwgA0/oIU4elTQDHw 33yHONZuJ5P4yYP5swgXARZft6fS75uGdpWGv3+aoW/4+Gavf0/ujUi2XaS8KrqIK03B wVZ7jtSxANk7NbIx8lcPl4ayEXyGSAKpPa0OZjqvJyRIe76arAKaXRnKNX64ft70R/5u JXow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=7vRX9dHXGTzQ47vNXN04nmx53m3OY6q8nDLQsdzb2zM=; b=WXQXTACQDy66bv+XNUufZrF23WlkKGWW76d18QR5GlRkwnIacn/FoQmtgpmDY50VpT MmVm093VmE1DMX07saLmiRYcrVEfZpmmldrg2qxaNeVHdYEC7lAEm8qVQ73fgH/dvbBa mXjqIxUev7b7v1wDC6yegnQFZREa9r+6ui4S67QtE9zWKFkkoRRx8/YnjreIQUgPhmYj wlEWETOQgX63pXurCJRtPJLKCTpajyHHCLoRoVLexoj5RyJhWDZvpfOLeD7lPNb7FUvD P/ebck4g+Qia4e0vvB8bDO4NWc57oI+5ssqERi3/Ac6lw+pJ6joveszfQY7lvqNuUyUz 1e2w== X-Gm-Message-State: AA+aEWaCbMurYjAF+FkUiIr5X0KYLXvrY8y/i6bCAuYrS1kWGdwYHm2c swA3Kl9CeyaNf/KQh9eb7xwfhCxW X-Google-Smtp-Source: AFSGD/Wb8fT2RD75m2iQCPCgzicI1k+RP6GdYMIiDEMejDV/iygAF9Na6IGvwX4hvVYTQekuvWxbsw== X-Received: by 2002:adf:a1d2:: with SMTP id v18mr4863745wrv.87.1544867554097; Sat, 15 Dec 2018 01:52:34 -0800 (PST) Original-Received: from rpluim-mac (vav06-1-78-207-202-134.fbx.proxad.net. [78.207.202.134]) by smtp.gmail.com with ESMTPSA id o17sm10602332wmg.35.2018.12.15.01.52.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Dec 2018 01:52:32 -0800 (PST) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <133EC18A-49D2-4665-9E31-ED25CDD8A7EF@mnewton.com> (Matthew Newton's message of "Fri, 14 Dec 2018 22:37:33 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153479 Archived-At: Matthew Newton 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 di= splayed 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. s= izes 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=E2=80=9D? > $ 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