In Emacs, you can find, create, view, save, and otherwise work with files and file directories. This chapter describes most of the file-related functions of Emacs Lisp, but a few others are described in Buffers, and those related to backups and auto-saving are described in Backups and Auto-Saving.
Many of the file functions take one or more arguments that are file
names. A file name is actually a string. Most of these functions
expand file name arguments by calling
expand-file-name, so that
~ is handled correctly, as are relative file names (including
‘../’). These functions don't recognize environment variable
substitutions such as ‘$HOME’. See File Name Expansion.
When file I/O functions signal Lisp errors, they usually use the
file-error (see Handling Errors). The error
message is in most cases obtained from the operating system, according
system-message-locale, and decoded using coding system
locale-coding-system (see Locales).