From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matthew Newton Newsgroups: gmane.emacs.bugs Subject: bug#33757: 27.0.50; dired-du-mode displays incorrect human readable file sizes for non-GNU systems Date: Fri, 14 Dec 2018 22:37:33 -0800 Message-ID: <133EC18A-49D2-4665-9E31-ED25CDD8A7EF@mnewton.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544859188 10920 195.159.176.226 (15 Dec 2018 07:33:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Dec 2018 07:33:08 +0000 (UTC) To: 33757@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 15 08:33:03 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 1gY4Ra-0002fx-SV for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 08:33:03 +0100 Original-Received: from localhost ([::1]:38165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY4Th-0004sf-8s for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 02:35:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY4Ta-0004sB-Sz for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 02:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY4TW-0003dX-Ng for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 02:35:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gY4TW-0003d1-9s for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 02:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gY4TW-0002YW-1i for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 02:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Newton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Dec 2018 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15448592959805 (code B ref -1); Sat, 15 Dec 2018 07:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Dec 2018 07:34:55 +0000 Original-Received: from localhost ([127.0.0.1]:48919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY4TO-0002Y5-RF for submit@debbugs.gnu.org; Sat, 15 Dec 2018 02:34:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY3a9-00017t-Qm for submit@debbugs.gnu.org; Sat, 15 Dec 2018 01:37:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY3a3-0004Sp-PV for submit@debbugs.gnu.org; Sat, 15 Dec 2018 01:37:44 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gY3a3-0004Sg-K9 for submit@debbugs.gnu.org; Sat, 15 Dec 2018 01:37:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY3a2-00006z-Lh for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:37:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY3Zz-0004Qa-I3 for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:37:42 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:55769) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gY3Zz-0004Lv-6P for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:37:39 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5E7C011A3 for ; Sat, 15 Dec 2018 01:37:36 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 15 Dec 2018 01:37:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnewton.com; h= from:content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; s=fm2; bh=hE2BWruayRbAnX0SSYfxOXDAKBnPWrfrg zDHbcIvdIo=; b=5NqS9K22NCRZKYWDSfDAUB3qvntqfpUy3RRbxKV92UPV4mLQQ Z1wyIaRweK52z2bGTfxzQknu4+OoBi0pvwPYq/rfidXuSLSAKPiazZL4hOOYugPo dnn8ciqwmJweG4pHBPj9dlNB9hUWLpdBq/eNxceLhCfwwkQgYS3Y95SqjnP8Oqt3 4l8SimM2R/QXuPQmB6/07Nc56FhSqvN5PJebY2HvZwWUn0ftUY1OKYTNOCWhuyYb 6isRK7869gkfk3PTv5lDYw1+FASQMrgKq8bF8FS+wZChmFaW9GMXPZmpGclwzFbb sPOk3ZCZRqJYHzyoLv8ceiBdDXmvQRY+mzxYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hE2BWr uayRbAnX0SSYfxOXDAKBnPWrfrgzDHbcIvdIo=; b=c/DBLTTp0dhWGwVgl4Uy4v r0Oa+AutOqM9MpwDDTG+9hLFOR9o+DHvvdz41yDo06Zi41bzCc08yBi3HIoAvIoX sKZirnrfJHaue6cy7xupuyNGNflkeo/ELj3SxLlKkPJB1YdLiM1rPa9Qg6ibTjBa wrNCPc8mVwjfvHJ5Ieh8gpUdPuBSih8krte1VjUhRdilWG3WF10wI8orFw2pn57t bLXqXUxtRHVSywezLigMzd+oGuwCso8dmI/5964IvwIkLfY22sQr2/4dolKc1iSX nviBPbii6E1IS7RQMS+q7+HOZEZxjyrksK3dXM9DfCOQFFEDzPRO8YXEJpyNUV0g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudehiedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephfgtgfgguffkfffvofesthhqmhdthhdtjeenucfhrhhomhepof grthhthhgvficupfgvfihtohhnuceomhgrthhtsehmnhgvfihtohhnrdgtohhmqeenucfk phepudehjedrudefuddrvdehuddrgeelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg htthesmhhnvgifthhonhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Original-Received: from [192.168.0.115] (157-131-251-49.fiber.dynamic.sonic.net [157.131.251.49]) by mail.messagingengine.com (Postfix) with ESMTPA id 3D8EBE455C for ; Sat, 15 Dec 2018 01:37:35 -0500 (EST) X-Mailer: Apple Mail (2.3445.101.1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sat, 15 Dec 2018 02:34:54 -0500 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:153475 Archived-At: * 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=E2=80=9D? Cheers, Matt P.S. This is my first Emacs bug report so please help me out if I should = report it differently.=