Previous: Lisp Pathnames, Up: Pathnames


8.2 Native Filenames

In some circumstances, what is wanted is a Lisp pathname object which corresponds to a string produced by the Operating System. In this case, some of the default parsing rules are inappropriate: most filesystems do not have a native understanding of wild pathnames; such functionality is often provided by shells above the OS, often in mutually-incompatible ways.

To allow the user to deal with this, the following functions are provided: parse-native-namestring and native-pathname return the closest equivalent Lisp pathname to a given string (appropriate for the Operating System), while native-namestring converts a non-wild pathname designator to the equivalent native namestring, if possible. Some Lisp pathname concepts (such as the :back directory component) have no direct equivalents in most Operating Systems; the behaviour of native-namestring is unspecified if an inappropriate pathname designator is passed to it.

— Function: sb-ext:parse-native-namestring thing &optional host defaults &key start end junk-allowed

Convert thing into a pathname, using the native conventions appropriate for the pathname host host, or if not specified the host of defaults. If thing is a string, the parse is bounded by start and end, and error behaviour is controlled by junk-allowed, as with parse-namestring.

— Function: sb-ext:native-pathname pathspec

Convert pathspec (a pathname designator) into a pathname, assuming the operating system native pathname conventions.

— Function: sb-ext:native-namestring pathname

Construct the full native (name)string form of pathname.