Next: , Previous: , Up: Directory and File Variables and Functions   [Index]


7.2.3.15 expand-file-name

Convert a relative file name to an absolute one and canonacilize it. However, use ‘(directory-file-name (file-name-directory dirname))’ to traverse a filesystem tree, not ‘(expand-file-name ".." dirname)’.

Function: expand-file-name name &optional default-directory
NAME

a file name (a string that is a valid file name) upon which to operate: convert the file name to absolute and canonicalize it. ‘~/’ expands to the home directory. ‘~USER’ expands to USER’s home directory.

DEFAULT-DIRECTORY

a directory used to start with if NAME is relative (does not start with slash or tilde); this can be either a directory name or a directory file name; if nil or missing, the current buffer’s value of default-directory is used.

RETURN VALUE

an absolute, canonacalized file name.