Function: pdf-util-munch-file

pdf-util-munch-file is a natively compiled function defined in pdf-util.el.

Signature

(pdf-util-munch-file FILENAME &optional MULTIBYTE-P)

Documentation

Read contents from FILENAME and delete it.

Return the file's content as a unibyte string, unless MULTIBYTE-P is non-nil.

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-util.el
(defun pdf-util-munch-file (filename &optional multibyte-p)
  "Read contents from FILENAME and delete it.

Return the file's content as a unibyte string, unless MULTIBYTE-P
is non-nil."
  (unwind-protect
      (with-temp-buffer
        (set-buffer-multibyte multibyte-p)
        (insert-file-contents-literally filename)
        (buffer-substring-no-properties
         (point-min)
         (point-max)))
    (when (and filename
               (file-exists-p filename))
      (delete-file filename))))