From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Sep 2010 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6995@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128388964613158 (code B ref -1); Tue, 07 Sep 2010 20:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Sep 2010 20:00:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4LS-0003QB-Rd for submit@debbugs.gnu.org; Tue, 07 Sep 2010 16:00:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4LM-0003Q6-Qu for submit@debbugs.gnu.org; Tue, 07 Sep 2010 16:00:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ot4NA-0005Fx-RL for submit@debbugs.gnu.org; Tue, 07 Sep 2010 16:02:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:34690) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4NA-0005Fj-Kw for submit@debbugs.gnu.org; Tue, 07 Sep 2010 16:02:28 -0400 Received: from [140.186.70.92] (port=39369 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ot4N6-000159-89 for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2010 16:02:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ot44M-0002S6-FD for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2010 15:43:04 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:62221) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot44M-0002Ry-72 for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2010 15:43:02 -0400 Received: by ewy28 with SMTP id 28so3073051ewy.0 for ; Tue, 07 Sep 2010 12:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:organization :date:message-id:user-agent:mime-version:content-type; bh=j4wNaFhfGtY00TMyWXrnKdiFJiSZiYj3ufoCo7lYEp8=; b=l68bbCPcW9sutIfDVp+/trLbei8XqgsBA3Ag4Do32pJzK0sMMzNoC040HQM0bmQU8C vq6jJ0KSqfQaHnGA3tCJblpZlxUhy03uWv6hpZbipfvm5K5hITVHwncwVd/161l7trlJ UaGKfXTMH94giRzx/Eqymdg1FbRAC/wjbFUdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:organization:date:message-id:user-agent :mime-version:content-type; b=W7/WD3BEWrVY3ABXr8hjfhJ9HvPuetOtqE6Y9xRjQyE8h5RXVfm3oYwayW06a12rdm YGjjrp5qm2vSJGUOnSHNNq7Nuysj9xvYkg8w9fTKQRYSXskvG2zwJTxEqW7w5aJWEpso SBpIEBmuB32VWioiRV8YQ9+yc8TUkBw746jWA= Received: by 10.216.236.149 with SMTP id w21mr2334849weq.65.1283888581299; Tue, 07 Sep 2010 12:43:01 -0700 (PDT) Received: from tux.homenetwork (1.77.197-77.rev.gaoland.net [77.197.77.1]) by mx.google.com with ESMTPS id u11sm4429825weq.31.2010.09.07.12.42.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 07 Sep 2010 12:42:59 -0700 (PDT) From: Thierry Volpiatto Organization: ThierryVolpiatto Date: Tue, 07 Sep 2010 21:40:42 +0200 Message-ID: <87d3sp5olh.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Hi, The version of get-free-disk-space doesn't show available space in dired, please fix it or revert to 23.2 version. Actually it show: total 10120 instead of: total used in directory 9,9M available 24G BTW the bug i sent long time ago (with a patch) about insert-directory that doesn't show correctly available space when using h option of ls is still not fixed. e.g it should show something like: total used in directory 9,9M available 24G ^^^ In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-09-07 on tux Windowing system distributor `The X.Org Foundation', version 11.0.10707000 configured using `configure '--prefix=/usr' '--build=i686-pc-linux-gnu' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-24' '--infodir=/usr/share/info/emacs-24' '--with-crt-dir=/usr/lib' '--without-compress-info' '--with-sound' '--with-x' '--without-gconf' '--without-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--without-imagemagick' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=i686 -pipe -O2' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: C value of $LC_CTYPE: fr_FR.UTF-8 value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: fr_FR.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: global-undo-tree-mode: t undo-tree-mode: t eldoc-mode: t minibuffer-depth-indicate-mode: t auto-image-file-mode: t shell-dirtrack-mode: t show-paren-mode: t display-time-mode: t diff-auto-refine-mode: t recentf-mode: t savehist-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-< C-x C-f C-. C-. s c C-x C-f C-j C-x C-b C-SPC C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f M-w M-x r e p o r t Recent messages: Desktop lazily opening my-blog.org (2 remaining)...done Desktop lazily opening notes.org (1 remaining)... OVERVIEW Desktop lazily opening notes.org (1 remaining)...done Lazy desktop load complete Auto-saving...done Collecting symbols...done [3 times] Mark set Load-path shadows: /home/thierry/elisp/AC/auto-complete hides /home/thierry/elisp/auto-complete /home/thierry/elisp/subversion/psvn hides /usr/share/emacs/site-lisp/subversion/psvn ~/elisp/g-client/json hides /usr/share/emacs/24.0.50/lisp/json /usr/share/emacs/site-lisp/flim/hex-util hides /usr/share/emacs/24.0.50/lisp/hex-util /usr/share/emacs/site-lisp/flim/sha1 hides /usr/share/emacs/24.0.50/lisp/sha1 /usr/share/emacs/site-lisp/flim/md4 hides /usr/share/emacs/24.0.50/lisp/md4 /usr/share/emacs/site-lisp/flim/ntlm hides /usr/share/emacs/24.0.50/lisp/net/ntlm /usr/share/emacs/site-lisp/flim/hmac-def hides /usr/share/emacs/24.0.50/lisp/net/hmac-def /usr/share/emacs/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.0.50/lisp/net/sasl-digest /usr/share/emacs/site-lisp/flim/sasl hides /usr/share/emacs/24.0.50/lisp/net/sasl /usr/share/emacs/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.0.50/lisp/net/hmac-md5 /usr/share/emacs/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.0.50/lisp/net/sasl-cram /usr/share/emacs/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.0.50/lisp/net/sasl-ntlm /home/thierry/elisp/emms/lisp/tq hides /usr/share/emacs/24.0.50/lisp/emacs-lisp/tq Features: (shadow gnus-cite gnus-demon gnus-namazu gnus-dired nnshimbun shimbun luna eword-encode eword-decode std11 mel path-util mime-def mcharset mcs-20 mcs-e20 pces pces-e20 pces-20 broken pcustom poe gnus-bcklg spam spam-stat bbdb-com bbdb gnus-uu yenc gnus-alias mail-extr gnus-msg emacsbug xhg-dvc xhg xhg-annotate xhg-mq xhg-log vc-rcs align-let server finder-inf package google-maps google-maps-static google-maps-geocode google-maps-base json simple-call-tree el-expectations el-mock csv2org iedit eieio-base eieio zop-to-char elscreen-server elscreen-dired elscreen-w3m mule-util alist pym static apel-ver product elscreen undo-tree smallurl mm-url xml-weather rectangle-utils auto-document eiv tv-utils eldoc pcvs pcvs-parse pcvs-info pcvs-defs init-anything-thierry descbinds-anything anything-ipython shell-history anything-complete anything-show-completion anything-etags anything-match-plugin etags anything-traverse anything-delicious anything-mercurial addressbook-bookmark bzr-core cg-core xdarcs-core xgit-core xhg-core xmtn-minimal tla smerge-mode dvc-state dvc-config dvc-diff dvc-fileinfo diff dvc-cmenu dvc-about dvc-version dvc-revlist uniquify anything-config w3m-bookmark rx anything firefox-protocol bookmark-firefox-handler bookmark-extensions bookmark install-elisp find-func mb-depth autodoc ioccur traverselisp thumb-page moz cl-info slime-xref-browser slime-banner slime-tramp slime-asdf slime-fancy slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-parse slime-repl slime apropos hideshow hyperspec thingatpt slime-autoloads boxquote rect image-file tramp-imap tramp-gw tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp tramp-compat trampver newsticker newst-treeview newst-plainview newst-reader newst-ticker newst-backend ledger pcomplete esh-arg esh-util lpr woman man assoc two-column shell-command em-term term ehelp electric esh-toggle em-xtra flymake pdbtrack pycomplete pymacs ipython python-mode info-look ansi-color executable shell no-word regex-tool whitespace htmlfontify paren time dired-tar compile dired-extension image-dired dired-details yaoddmuse skeleton sgml-mode emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-lastfm-client xml parse-time emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer emms-info emms-streams later-do emms-source-playlist emms-source-file emms-player-simple emms-setup emms emms-compat winner dvc-init bzr-gnus tla-gnus xgit-gnus xhg-gnus gnus-art mm-uu mml2015 mm-view smime password-cache dig dvc-gnus tla-core pp tla-autoconf tla-defs dvc-log vc vc-dispatcher dvc-unified dvc-tips dired-x dired-aux ffap ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff dvc-autoloads dvc-core dvc-lisp dvc-buffers dvc-ui dvc-register dvc-utils dvc-emacs ewoc dvc-defs dvc-site psvn log-edit pcvs-util add-log diff-mode htmlize-hack htmlize muse-colors muse-docbook muse-texinfo texnfo-upd texinfo muse-latex muse-html muse-xml-common muse-wiki cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode muse-autoloads org-config-thierry org-crypt cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs vc-hg org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-info org-gnus org-docview org-bibtex org-bbdb org-agenda appt diary-lib diary-loaddefs org-annotation-helper url url-proxy url-privacy url-expand url-methods url-history url-cookie url-util url-parse url-vars mailcap org-capture org-mks remember org-remember org-datetree org byte-opt warnings bytecomp byte-compile ob-emacs-lisp ob-keys ob-comint comint ring ob-tangle ob-ref ob-lob ob-table ob org-footnote org-src org-list org-faces org-compat org-entities org-macs noutline outline cal-menu calendar cal-loaddefs config-w3m w3m browse-url doc-view jka-compr image-mode timezone w3m-hist w3m-fb w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util mime-w3m w3m-load recentf tree-widget savehist epa-file epa derived epg epg-config auth-source dired gnus-async nntp gnus-sum nnoo gnus-group time-date gnus-undo nnmail mail-source format-spec gnus-start gnus-spec gnus-int gnus-range message sendmail regexp-opt rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit info easymenu usage-memo desktop punycode idna basic-theme edmacro kmacro eev-thierry iterator eev-all eev-mini-steps eev-browse-url eev-langs eev-compose eev-glyphs disp-table eev-insert eev-steps eev-bounded eev easy-mmode advice help-fns advice-preload cl cl-19 site-gentoo w3m-wget preview-latex tex-site auto-loads tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- Thierry Volpiatto Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Sep 2010 20:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Thierry Volpiatto Cc: 6995@debbugs.gnu.org Received: via spool by 6995-submit@debbugs.gnu.org id=B6995.128389164613989 (code B ref 6995); Tue, 07 Sep 2010 20:35:02 +0000 Received: (at 6995) by debbugs.gnu.org; 7 Sep 2010 20:34:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4rm-0003da-Fn for submit@debbugs.gnu.org; Tue, 07 Sep 2010 16:34:06 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ot4rl-0003dA-5o for 6995@debbugs.gnu.org; Tue, 07 Sep 2010 16:34:05 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Ot4td-00070z-3A; Tue, 07 Sep 2010 16:36:01 -0400 References: <87d3sp5olh.fsf@tux.homenetwork> From: Glenn Morris X-Spook: illuminati MDA Leitrim encryption S Key Tony Blair X-Ran: TB(1ZEANP4ND?0TR:K|Y%'mxi8i}|BkYiHb@",{.3}#&,P=}1mHYT:k8lz4mH8Ik\LgOlm X-Hue: yellow X-Attribution: GM Date: Tue, 07 Sep 2010 16:36:01 -0400 In-Reply-To: <87d3sp5olh.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Tue\, 07 Sep 2010 21\:40\:42 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Thierry Volpiatto wrote: > The version of get-free-disk-space doesn't show available space in > dired, please fix it or revert to 23.2 version. > > Actually it show: > total 10120 > > instead of: > total used in directory 9,9M available 24G Allow me to offer more details: On my system, where my home directory is NFS mounted, df -Pk /home/user returns Filesystem 1024-blocks Used Available Capacity Mounted on /real_directory/home/user 461097104 333392304 127704800 73% /home/user Because the filesystem name is long, the numerical values do not line up with the column headings. The current code seems to assume that they do line up. Thus, running dired on "~" gets wrong values for the total size. From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2010 06:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 6995@debbugs.gnu.org, thierry.volpiatto@gmail.com Reply-To: Eli Zaretskii Received: via spool by 6995-submit@debbugs.gnu.org id=B6995.128436085232419 (code B ref 6995); Mon, 13 Sep 2010 06:55:02 +0000 Received: (at 6995) by debbugs.gnu.org; 13 Sep 2010 06:54:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov2vc-0008Qq-4A for submit@debbugs.gnu.org; Mon, 13 Sep 2010 02:54:12 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov2vZ-0008Qk-8j for 6995@debbugs.gnu.org; Mon, 13 Sep 2010 02:54:10 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0L8O00300B81P300@a-mtaout22.012.net.il> for 6995@debbugs.gnu.org; Mon, 13 Sep 2010 08:56:19 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.81.53]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L8O003NLB9UA340@a-mtaout22.012.net.il>; Mon, 13 Sep 2010 08:56:19 +0200 (IST) Date: Mon, 13 Sep 2010 08:56:19 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83aanm5dyk.fsf@gnu.org> References: <87d3sp5olh.fsf@tux.homenetwork> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Glenn Morris > Date: Tue, 07 Sep 2010 16:36:01 -0400 > Cc: 6995@debbugs.gnu.org > > df -Pk /home/user > > returns > > Filesystem 1024-blocks Used Available Capacity Mounted on > /real_directory/home/user 461097104 333392304 127704800 73% /home/user > > Because the filesystem name is long, the numerical values do not line > up with the column headings. The current code seems to assume that > they do line up. Thus, running dired on "~" gets wrong values for the > total size. How about dropping the use of `df', at least on GNU/Linux? It's IMO ridiculous to invoke an external program for a single system call. I know that this system call is notoriously non-portable, and that doing in Emacs all that system-dependent stuff that `df' does is not a good idea. But at least on the most popular free system (and perhaps on a few compatible ones) we could do it right without all that labor, and gain stability and reliability that depending on `df' will never achieve. From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2010 10:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Glenn Morris , 6995@debbugs.gnu.org, thierry.volpiatto@gmail.com Received: via spool by 6995-submit@debbugs.gnu.org id=B6995.12843727805408 (code B ref 6995); Mon, 13 Sep 2010 10:13:02 +0000 Received: (at 6995) by debbugs.gnu.org; 13 Sep 2010 10:13:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov61z-0001PB-W1 for submit@debbugs.gnu.org; Mon, 13 Sep 2010 06:13:00 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov61y-0001P5-C9 for 6995@debbugs.gnu.org; Mon, 13 Sep 2010 06:12:59 -0400 Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm1.telefonica.net with bizsmtp id 672f1f00i0r0BT601AEyRL; Mon, 13 Sep 2010 12:14:58 +0200 Received: from ceviche.home ([83.61.39.212]) by IMPmailhost2.adm.correo with BIZ IMP id 6AEx1f00C4aeRwb1iAEyRi; Mon, 13 Sep 2010 12:14:58 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 10AD46637B; Mon, 13 Sep 2010 12:14:57 +0200 (CEST) From: Stefan Monnier Message-ID: References: <87d3sp5olh.fsf@tux.homenetwork> <83aanm5dyk.fsf@gnu.org> Date: Mon, 13 Sep 2010 12:14:56 +0200 In-Reply-To: <83aanm5dyk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Sep 2010 08:56:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > How about dropping the use of `df', at least on GNU/Linux? It's IMO > ridiculous to invoke an external program for a single system call. I > know that this system call is notoriously non-portable, and that doing > in Emacs all that system-dependent stuff that `df' does is not a good > idea. But at least on the most popular free system (and perhaps on a > few compatible ones) we could do it right without all that labor, and > gain stability and reliability that depending on `df' will never > achieve. That would make a lot of sense, yes, Stefan From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired In-Reply-To: <87d3sp5olh.fsf@tux.homenetwork> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2010 13:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128438414815581 (code B ref -1); Mon, 13 Sep 2010 13:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Sep 2010 13:22:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov8zM-00043G-1K for submit@debbugs.gnu.org; Mon, 13 Sep 2010 09:22:28 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov8zJ-000439-KP for submit@debbugs.gnu.org; Mon, 13 Sep 2010 09:22:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov91M-0002D3-Pz for submit@debbugs.gnu.org; Mon, 13 Sep 2010 09:24:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:58338) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov91M-0002Cz-Nh for submit@debbugs.gnu.org; Mon, 13 Sep 2010 09:24:32 -0400 Received: from [140.186.70.92] (port=42691 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov91L-0000Io-Gv for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2010 09:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov91K-0002CV-A7 for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2010 09:24:31 -0400 Received: from lo.gmane.org ([80.91.229.12]:51809) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov91J-0002CE-SN for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2010 09:24:30 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ov91E-0000GP-3R for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2010 15:24:24 +0200 Received: from 72.211.85-79.rev.gaoland.net ([79.85.211.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Sep 2010 15:24:24 +0200 Received: from thierry.volpiatto by 72.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Sep 2010 15:24:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Mon, 13 Sep 2010 15:22:17 +0200 Organization: ThierryVolpiatto Lines: 57 Message-ID: <87pqwh3hiu.fsf@tux.homenetwork> References: <87d3sp5olh.fsf@tux.homenetwork> <83aanm5dyk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 72.211.85-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:R4qm1JA6CVl4JivCyVLoVM3p+nM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) Stefan Monnier writes: >> How about dropping the use of `df', at least on GNU/Linux? It's IMO >> ridiculous to invoke an external program for a single system call. I >> know that this system call is notoriously non-portable, and that doing >> in Emacs all that system-dependent stuff that `df' does is not a good >> idea. But at least on the most popular free system (and perhaps on a >> few compatible ones) we could do it right without all that labor, and >> gain stability and reliability that depending on `df' will never >> achieve. > > That would make a lot of sense, yes, I agree too, but waiting such a change, you should rewrite `get-free-disk-space' as it can't work correctly on the output of df. ,---- | ;; Usual format is as follows: | ;; Filesystem ... Used Available Capacity ... | ;; /dev/sda6 ...48106535 35481255 10669850 ... | (goto-char (point-min)) | (when (re-search-forward " +Avail[^ \n]*" `---- But usual format is not the same on all locales: Here it is: ,---- | Sys. de fichiers 1024-blocs Utilisé Dispo. Capacité Monté sur | /dev/sda7 48947688 21618816 24842416 47% /home `---- So (re-search-forward " +Avail[^ \n]*" is not portable here. I use this simplified version of get-free-disk-space if it can help: ,---- | (defun get-free-disk-space (dir) | (let* ((data (with-temp-buffer | (call-process directory-free-space-program | nil t nil | directory-free-space-args | dir) | (split-string (buffer-string) "\n" t))) | (values (cdr (split-string (second data))))) | (nth 2 values))) `---- Tough the version on 23.2 work also. Note that the value of "total used in directory" is always wrong. How do you get this value? -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired In-Reply-To: <87d3sp5olh.fsf@tux.homenetwork> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Sep 2010 18:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128457598117981 (code B ref -1); Wed, 15 Sep 2010 18:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Sep 2010 18:39:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvwtR-0004fy-85 for submit@debbugs.gnu.org; Wed, 15 Sep 2010 14:39:41 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvwtO-0004ft-Rv for submit@debbugs.gnu.org; Wed, 15 Sep 2010 14:39:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvwvX-0006Db-LA for submit@debbugs.gnu.org; Wed, 15 Sep 2010 14:41:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60963) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvwvW-0006DA-WD for submit@debbugs.gnu.org; Wed, 15 Sep 2010 14:41:51 -0400 Received: from [140.186.70.92] (port=56494 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvwvS-0005o8-Ta for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2010 14:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvwvR-0006Ca-1Y for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2010 14:41:46 -0400 Received: from lo.gmane.org ([80.91.229.12]:58417) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvwvQ-0006CP-Jr for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2010 14:41:45 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OvwvN-0000s3-OK for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2010 20:41:41 +0200 Received: from 2.77.197-77.rev.gaoland.net ([77.197.77.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Sep 2010 20:41:41 +0200 Received: from thierry.volpiatto by 2.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Sep 2010 20:41:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Wed, 15 Sep 2010 20:39:39 +0200 Organization: ThierryVolpiatto Lines: 80 Message-ID: <87hbhq97h0.fsf@tux.homenetwork> References: <87d3sp5olh.fsf@tux.homenetwork> <83aanm5dyk.fsf@gnu.org> <87pqwh3hiu.fsf@tux.homenetwork> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 2.77.197-77.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:bb4oUXK5uKaxI26VVzN6+3CIzsk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Thierry Volpiatto writes: > Stefan Monnier writes: > >>> How about dropping the use of `df', at least on GNU/Linux? It's IMO >>> ridiculous to invoke an external program for a single system call. I >>> know that this system call is notoriously non-portable, and that doing >>> in Emacs all that system-dependent stuff that `df' does is not a good >>> idea. But at least on the most popular free system (and perhaps on a >>> few compatible ones) we could do it right without all that labor, and >>> gain stability and reliability that depending on `df' will never >>> achieve. >> >> That would make a lot of sense, yes, > > I agree too, but waiting such a change, you should rewrite > `get-free-disk-space' as it can't work correctly on the output of df. > > ,---- > | ;; Usual format is as follows: > | ;; Filesystem ... Used Available Capacity ... > | ;; /dev/sda6 ...48106535 35481255 10669850 ... > | (goto-char (point-min)) > | (when (re-search-forward " +Avail[^ \n]*" > `---- > > But usual format is not the same on all locales: > Here it is: > > ,---- > | Sys. de fichiers 1024-blocs Utilisé Dispo. Capacité Monté sur > | /dev/sda7 48947688 21618816 24842416 47% /home > `---- > > So (re-search-forward " +Avail[^ \n]*" is not portable here. > > I use this simplified version of get-free-disk-space if it can help: > > ,---- > | (defun get-free-disk-space (dir) > | (let* ((data (with-temp-buffer > | (call-process directory-free-space-program > | nil t nil > | directory-free-space-args > | dir) > | (split-string (buffer-string) "\n" t))) > | (values (cdr (split-string (second data))))) > | (nth 2 values))) > `---- With the windows stuff and no call when remote: (defun get-free-disk-space (dir) (unless (file-remote-p dir) ;; Try to find the number of free blocks. Non-Posix systems don't ;; always have df, but might have an equivalent system call. (if (fboundp 'file-system-info) (let ((fsinfo (file-system-info dir))) (if fsinfo (format "%.0f" (/ (nth 2 fsinfo) 1024)))) (when (executable-find directory-free-space-program) (let* ((data (with-temp-buffer (call-process directory-free-space-program nil t nil directory-free-space-args dir) (split-string (buffer-string) "\n" t))) (values (cdr (split-string (second data))))) (when data (nth 2 values))))))) > Tough the version on 23.2 work also. > > Note that the value of "total used in directory" is always wrong. > How do you get this value? -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired In-Reply-To: <87d3sp5olh.fsf@tux.homenetwork> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Sep 2010 13:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12848180692239 (code B ref -1); Sat, 18 Sep 2010 13:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Sep 2010 13:54:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owxs5-0000a4-5W for submit@debbugs.gnu.org; Sat, 18 Sep 2010 09:54:29 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owxs2-0000Zz-TS for submit@debbugs.gnu.org; Sat, 18 Sep 2010 09:54:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwxuK-0006Jz-Nd for submit@debbugs.gnu.org; Sat, 18 Sep 2010 09:56:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:59265) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwxuK-0006Jt-Kt for submit@debbugs.gnu.org; Sat, 18 Sep 2010 09:56:48 -0400 Received: from [140.186.70.92] (port=41410 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwxuJ-00033F-E4 for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 09:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwxuI-0006Iq-57 for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 09:56:47 -0400 Received: from lo.gmane.org ([80.91.229.12]:44348) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwxuH-0006IV-Rv for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 09:56:46 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OwxuD-0008L9-DA for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 15:56:41 +0200 Received: from 46.78.88-79.rev.gaoland.net ([79.88.78.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 15:56:41 +0200 Received: from thierry.volpiatto by 46.78.88-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 15:56:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Sat, 18 Sep 2010 15:54:45 +0200 Organization: ThierryVolpiatto Lines: 53 Message-ID: <87r5grxil6.fsf@tux.homenetwork> References: <87d3sp5olh.fsf@tux.homenetwork> <83aanm5dyk.fsf@gnu.org> <87pqwh3hiu.fsf@tux.homenetwork> <87hbhq97h0.fsf@tux.homenetwork> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 46.78.88-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:88PysMTULsFepXHAGSTQSBZzoLw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) Thierry Volpiatto writes: > With the windows stuff and no call when remote: > > (defun get-free-disk-space (dir) > (unless (file-remote-p dir) > ;; Try to find the number of free blocks. Non-Posix systems don't > ;; always have df, but might have an equivalent system call. > (if (fboundp 'file-system-info) > (let ((fsinfo (file-system-info dir))) > (if fsinfo > (format "%.0f" (/ (nth 2 fsinfo) 1024)))) > (when (executable-find directory-free-space-program) > (let* ((data (with-temp-buffer > (call-process directory-free-space-program > nil t nil > directory-free-space-args > dir) > (split-string (buffer-string) "\n" t))) > (values (cdr (split-string (second data))))) > (when data (nth 2 values))))))) > But may be it's better to have other infos from output of df available: (defun get-free-disk-space (dir &optional human) (unless (file-remote-p dir) ;; That is for windows. (if (fboundp 'file-system-info) (let ((fsinfo (file-system-info dir))) (if fsinfo (format "%.0f" (/ (nth 2 fsinfo) 1024)))) ;; And this is for Unix/GNULinux. (when (executable-find directory-free-space-program) (getf (tv-get-disk-info dir human) :available))))) (defun tv-get-disk-info (dir &optional human) (let* (args (if human (concat directory-free-space-args "h") directory-free-space-args) (data (with-temp-buffer (call-process directory-free-space-program nil t nil args dir) (split-string (buffer-string) "\n" t))) (values (split-string (second data)))) (loop for i in '(:device :blocks :used :available :capacity :mount-point) for j in values append (list i j)))) -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Sep 2010 20:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 6995@debbugs.gnu.org, Thierry Volpiatto Received: via spool by 6995-submit@debbugs.gnu.org id=B6995.128544570213325 (code B ref 6995); Sat, 25 Sep 2010 20:15:04 +0000 Received: (at 6995) by debbugs.gnu.org; 25 Sep 2010 20:15:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozb9B-0003So-PA for submit@debbugs.gnu.org; Sat, 25 Sep 2010 16:15:01 -0400 Received: from pantheon-po24.its.yale.edu ([130.132.50.118]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozb99-0003Sj-7J for 6995@debbugs.gnu.org; Sat, 25 Sep 2010 16:14:59 -0400 Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po24.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o8PKHg5P004723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 25 Sep 2010 16:17:42 -0400 Received: by furry (Postfix, from userid 1000) id 37D9E16D402; Sat, 25 Sep 2010 16:17:42 -0400 (EDT) From: Chong Yidong References: <87d3sp5olh.fsf@tux.homenetwork> Date: Sat, 25 Sep 2010 16:17:42 -0400 In-Reply-To: (Glenn Morris's message of "Tue, 07 Sep 2010 16:36:01 -0400") Message-ID: <87aan51st5.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Glenn Morris writes: > Because the filesystem name is long, the numerical values do not line > up with the column headings. The current code seems to assume that > they do line up. Thus, running dired on "~" gets wrong values for the > total size. I've just checked in a change to use the "%" as an anchor for finding the available space, instead of assuming the columns line up. Patches to avoid using `df' welcome... From unknown Fri Aug 15 19:35:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6995: 24.0.50; get-free-disk-space doesn't return available space in dired In-Reply-To: <87d3sp5olh.fsf@tux.homenetwork> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Sep 2010 08:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128557704515391 (code B ref -1); Mon, 27 Sep 2010 08:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Sep 2010 08:44:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P09Jb-00040B-EE for submit@debbugs.gnu.org; Mon, 27 Sep 2010 04:44:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P09JY-0003zo-3O for submit@debbugs.gnu.org; Mon, 27 Sep 2010 04:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P09ME-00007k-7w for submit@debbugs.gnu.org; Mon, 27 Sep 2010 04:46:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60745) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P09ME-00007c-29 for submit@debbugs.gnu.org; Mon, 27 Sep 2010 04:46:46 -0400 Received: from [140.186.70.92] (port=40340 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P09M9-0005Ky-II for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2010 04:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P09El-0007YS-5F for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2010 04:39:04 -0400 Received: from lo.gmane.org ([80.91.229.12]:43315) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P09Ek-0007Y6-W5 for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2010 04:39:03 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P09Eh-0003RZ-8z for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2010 10:38:59 +0200 Received: from 33.77.197-77.rev.gaoland.net ([77.197.77.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Sep 2010 10:38:59 +0200 Received: from thierry.volpiatto by 33.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Sep 2010 10:38:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ From: Thierry Volpiatto Date: Mon, 27 Sep 2010 10:37:14 +0200 Organization: ThierryVolpiatto Lines: 20 Message-ID: <877hi7lgzp.fsf@tux.homenetwork> References: <87d3sp5olh.fsf@tux.homenetwork> <87aan51st5.fsf@stupidchicken.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 33.77.197-77.rev.gaoland.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) Cancel-Lock: sha1:VQzL2CoBA+eNh1c4GUBwlnQZgow= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.2 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) Chong Yidong writes: > Glenn Morris writes: > >> Because the filesystem name is long, the numerical values do not line >> up with the column headings. The current code seems to assume that >> they do line up. Thus, running dired on "~" gets wrong values for the >> total size. > > I've just checked in a change to use the "%" as an anchor for finding > the available space, instead of assuming the columns line up. Patches > to avoid using `df' welcome... I don't understand why you want to use regexp searching here... But well, it work...and you can get only one info from the output of df. Seem you didn't look at what i sent here... -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 20:33:51 2010 Received: (at control) by debbugs.gnu.org; 12 Oct 2010 00:33:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5SoR-0006Fb-BJ for submit@debbugs.gnu.org; Mon, 11 Oct 2010 20:33:51 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P5SoO-0006FU-Hr for control@debbugs.gnu.org; Mon, 11 Oct 2010 20:33:49 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1P5Sri-0002cW-6R; Mon, 11 Oct 2010 20:37:14 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19635.44474.182726.118719@fencepost.gnu.org> Date: Mon, 11 Oct 2010 20:37:14 -0400 From: Glenn Morris To: control Subject: close 6995 X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: |2yPUKbQ4QS,6gww5V1otY43u@@W0ym{z3Yr>'Wz|wgto}``NhvV*gu0}3W\v&V4Y-Ze@E X-Debbugs-No-Ack: yes X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) close 6995