Next: , Previous: File-descriptors, Up: Types


15.3.2.2 Filenames

A filename is a string.

A pathname is a designator for a filename: the filename is computed using the same mechanism that SBCL uses to map pathnames to OS filenames internally.

Note that filename syntax is distinct from namestring syntax, and that SB-EXT:PARSE-NATIVE-NAMESTRING may be used to construct Lisp pathnames that denote POSIX filenames returned by system calls. See Function sb-ext:parse-native-namestring. Additionally, notice that POSIX filename syntax does not distinguish the names of files from the names of directories. Consequently, in order to parse the name of a directory in POSIX filename syntax into a pathname defaults for which

     (merge-pathnames (make-pathname :name "FOO" :case :common)
                      defaults)

returns a pathname that denotes a file in the directory, it's necessary to append a forward slash to the POSIX filename. Otherwise, the last directory name will be parsed as a filename.