Next: , Previous: , Up: File Names   [Contents][Index]

35.8.3 Absolute and Relative File Names

All the directories in the file system form a tree starting at the root directory. A file name can specify all the directory names starting from the root of the tree; then it is called an absolute file name. Or it can specify the position of the file in the tree relative to a default directory; then it is called a relative file name. On Unix, an absolute file name starts with a slash or a tilde (‘~’), and a relative one does not.

Function: file-name-absolute-p filename

This function returns t if file filename is an absolute file name, nil otherwise.

(file-name-absolute-p "~rms/foo")
     ⇒ t
(file-name-absolute-p "rms/foo")
     ⇒ nil
(file-name-absolute-p "/user/rms/foo")
     ⇒ t