Function: get-free-disk-space

get-free-disk-space is a byte-compiled function defined in files.el.gz.

Signature

(get-free-disk-space DIR)

Documentation

String describing the amount of free space on DIR's file system.

If DIR's free space cannot be obtained, this function returns nil.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun get-free-disk-space (dir)
  "String describing the amount of free space on DIR's file system.
If DIR's free space cannot be obtained, this function returns nil."
  (save-match-data
    (let ((avail (nth 2 (file-system-info dir))))
      (if avail
          (funcall byte-count-to-string-function avail)))))