Chapter 19. Filenames [chap-19]

Table of Contents

19.1. Pathname Components sec_19-2-1
19.1.1. Directory canonicalization
19.1.2. Platform-specific issues
19.2. :UNSPECIFIC as a Component Value sec_19-2-2-2-3
19.3. External notation
19.4. Logical Pathnames sec_19-3
19.5. Miscellaneous
19.5.1. Function TRANSLATE-PATHNAME
19.5.2. Function TRANSLATE-LOGICAL-PATHNAME
19.5.3. Function PARSE-NAMESTRING
19.5.4. Function MERGE-PATHNAMES
19.5.5. Function LOAD-LOGICAL-PATHNAME-TRANSLATIONS
19.5.6. Function EXT:ABSOLUTE-PATHNAME

For most operations, pathnames denoting files and pathnames denoting directories cannot be used interchangeably.

Platform Dependent: UNIX platform only.
For example, #P"foo/bar" denotes the file #P"bar" in the directory #P"foo", while #P"foo/bar/" denotes the subdirectory #P"bar" of the directory #P"foo".
Platform Dependent: Win32 platform only.
For example, #P"foo\\bar" denotes the file #P"bar" in the directory #P"foo", while #P"foo\\bar\\" denotes the subdirectory #P"bar" of the directory #P"foo".
Platform Dependent: Win32 and Cygwin platforms only.
User variable CUSTOM:*DEVICE-PREFIX* controls translation between Cygwin pathnames (e.g., #P"/cygdrive/c/gnu/clisp/") and native Win32 pathnames (e.g., #P"C:\\gnu\\clisp\\") When it is set to NIL, no translations occur and the Cygwin port will not understand the native paths and the native Win32 port will not understand the Cygwin paths. When its value is a string, it is used by PARSE-NAMESTRING to translate into the appropriate platform-specific representation, so that on Cygwin, (PARSE-NAMESTRING "c:/gnu/clisp/") returns #P"/cygdrive/c/gnu/clisp/", while on Win32 (PARSE-NAMESTRING "/cygdrive/c/gnu/clisp/") returns #P"C:/gnu/clisp/". The initial value is "cygdrive", you should edit config.lisp to change it.

This is especially important for the directory-handling functions.

Table 19.1. The minimum filename syntax that may be used portably

pathnamemeaning
"xxx"for a file with name xxx
"xxx.yy"for a file with name xxx and type yy
".yy"for a pathname with type yy and no name or with name .yy and no type, depending on the value of CUSTOM:*PARSE-NAMESTRING-DOT-FILE*.

Hereby xxx denotes 1 to 8 characters, and yy denotes 1 to 3 characters, each of which being either an alphanumeric character or the underscore #\_. Other properties of pathname syntax vary between operating systems.


These notes document CLISP version 2.49.93+Last modified: 2018-02-19