Elisp: Read File
If you don't care about speed, use
to open a file into buffer. Then you can process it.
to save, like you would with using emacs.
If the file doesn't exit, it'll be created when you save it.
has lots side-effects. It will call all functions in
find-file-hook. Many packages and major modes add stuff to that hook.
It'll load a major mode (which does syntax coloring, usually very slow),
it'll record undo for any modification in the buffer.
Open File for Reading in Batch Script
To process thousands of files, read only, use
(defun my-process-file (fPath) "Process the file at path FPATH …" (with-temp-buffer (insert-file-contents fPath) ;; process it … ))