Function: f-empty-p

f-empty-p is a byte-compiled function defined in f.el.

Signature

(f-empty-p PATH)

Documentation

If PATH is a file, return t if the file in PATH is empty, nil otherwise.

If PATH is directory, return t if directory has no files, nil otherwise.

Other relevant functions are documented in the f group.

Shortdoc

;; f
(f-empty-p "/path/to/empty-file")
    => t
  (f-empty-p "/path/to/file-with-contents")
    => nil
  (f-empty-p "/path/to/empty-dir/")
    => t
  (f-empty-p "/path/to/dir-with-contents/")
    => nil

Aliases

f-empty?

Source Code

;; Defined in ~/.emacs.d/elpa/f-20241003.1131/f.el
(defun f-empty-p (path)
  "If PATH is a file, return t if the file in PATH is empty, nil otherwise.
If PATH is directory, return t if directory has no files, nil otherwise."
  (if (f-directory-p path)
      (equal (f-files path nil t) nil)
    (= (f-size path) 0)))