From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#28639: 26.0.60; get-free-disk-space gives wrong number on OS X 10.8 and later Date: Fri, 29 Sep 2017 13:01:40 +0900 Organization: Faculty of Science, Chiba University Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1506657798 25629 195.159.176.226 (29 Sep 2017 04:03:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2017 04:03:18 +0000 (UTC) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?Q?Shij=C5=8D?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) To: 28639@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 29 06:03:11 2017 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 1dxmW4-0005Xb-0x for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Sep 2017 06:03:08 +0200 Original-Received: from localhost ([::1]:33620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxmW8-0003o4-4L for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Sep 2017 00:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxmW2-0003nn-50 for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxmVy-0003aV-UX for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:03:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56926) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxmVy-0003aQ-Ql for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dxmVy-0006eA-JC for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2017 04:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28639 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.150665772225467 (code B ref -1); Fri, 29 Sep 2017 04:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2017 04:02:02 +0000 Original-Received: from localhost ([127.0.0.1]:37374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxmUz-0006ca-GQ for submit@debbugs.gnu.org; Fri, 29 Sep 2017 00:02:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxmUv-0006cL-UV for submit@debbugs.gnu.org; Fri, 29 Sep 2017 00:01:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxmUp-0003Ce-Iq for submit@debbugs.gnu.org; Fri, 29 Sep 2017 00:01:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxmUp-0003Ca-FO for submit@debbugs.gnu.org; Fri, 29 Sep 2017 00:01:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxmUn-0003RN-Tw for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:01:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxmUk-0003BB-SN for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:01:50 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:59937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxmUk-0003AB-5o for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2017 00:01:46 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id A203CF0906 for ; Fri, 29 Sep 2017 13:01:40 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:137556 Archived-At: The function `get-free-disk-space' in files.el gives free inode count rather than free data block space on OS X 10.8 and later. This is because it relies on the "df" command and parse the output as follows: ;; Assume that the "available" column is before the ;; "capacity" column. Find the "%" and scan backward. (goto-char (point-min)) (forward-line 1) (when (re-search-forward "[[:space:]]+[^[:space:]]+%[^%]*$" (line-end-position) t) (goto-char (match-beginning 0)) (let ((endpt (point))) (skip-chars-backward "^[:space:]") (buffer-substring-no-properties (point) endpt))))))))) The output on OS X 10.8 looks like this: Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk2 1996082176 172984304 1822585872 9% 2508930 4292458349 0% / devfs 371 371 0 100% 642 0 100% /dev map -hosts 0 0 0 100% 0 0 100% /net map auto_home 0 0 0 100% 0 0 100% /home So, `get-free-disk-space' adopts the "ifree" column rather than the "Available" column. One could use the "-P" option to suppress the inode columns. But this doesn't seem to be smart (cf. Bug#6995). Some platforms rely on the primitive function `file-system-info' instead of the "df" output to get free space. How about implementing `file-system-info' also for other platforms using the fsusage module in Gnulib? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp In GNU Emacs 26.0.60 (build 1, x86_64-apple-darwin16.7.0, X toolkit, Xaw3d scroll bars) of 2017-09-29 built on YAMAMOTO-no-iMac-5K.local Repository revision: af130f900fc499f71ea22f10ba055a75ce35ed4e Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: Loading /usr/local/pkg/ProofGeneral/generic/proof-site.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --without-ns --with-jpeg=no --with-gif=no --with-tiff=no --with-gnutls=no PKG_CONFIG=/opt/local/bin/pkg-config PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/lib/pkgconfig PKG_CONFIG_LIBDIR=' Configured features: XAW3D XPM PNG NOTIFY ACL LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 Important settings: value of $LANG: ja_JP.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: TeX-PDF-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message subr-x puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair ccc proof-site proof-autoloads pg-vars finder-inf info package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv preview prv-emacs tex-buf latex easy-mmode edmacro kmacro cl-loaddefs cl-lib tex-style tex crm advice easymenu tex-site auto-loads time-date mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote kqueue dynamic-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 156179 7929) (symbols 48 25864 2) (miscs 40 82 79) (strings 32 46730 1878) (string-bytes 1 1235094) (vectors 16 20402) (vector-slots 8 629738 10352) (floats 8 77 67) (intervals 56 197 0) (buffers 992 13))