[Openmcl-devel] buggy pathname escapes?

Gary Byers gb at clozure.com
Mon Jan 16 02:11:15 PST 2006


At least some of the problem is due to the fact that the character
that OpenMCL uses to escape/quote otherwise-syntactically-meaningful
characters in namestrings is #\\ (backslash), on the assumption that
no native namestring would ever contain a backslash character.  (From
what I can decode of the POSIX standard, that might be a valid
assumption, but since OSX (at least) allows pretty arbitrary characters
in pathnames and HFS+ supports Unicode, that's not a very useful
assumption,)  If that assumption's violated (if the "escape" character
is present in a namestring that comes from the filesystem), the escape
character's ... escaped.  Unless code is very careful to keep track
of whether an escape character (backslash) was introduced or present
in the "native" (filesystem) namestring, that's not a reversible
transformation and backslashes introduced to quote other backslashes
start getting quoted/escaped.

There might be a better choice of pathname escape character (a
character that -really- can't appear in a native namestring or the
8-bit representation of a Unicode pathname.  I haven't tried this
and don't know that I fully understand the implications, but what
happens if you do:

? (setq ccl::*pathname-escape-character* #\null)

?



On Mon, 16 Jan 2006, rs wrote:

> a file wich has an backslash in its name results in the following problems:
>
> [rs at giant:aaaBIN]$ ls -a /Volumes/CarryDaten/tobackup/Installer/Photoshop\ 
> 7.0.1\ Aktualisierung/
> .               ..              .DS_Store       \.3 .loop
>
>
> CL-USER> (directory #P"/Volumes/CarryDaten/tobackup/Installer/Photoshop 7.0.1 
> Aktualisierung/*")
> (#P"/Volumes/CarryDaten/tobackup/Installer/Photoshop 7.0.1 
> Aktualisierung/.DS_Store" #P"/Volumes/CarryDaten/tobackup/Installer/Photoshop 
> 7.0.1 Aktualisierung/\\\\\\\\\\.3 .loop")
>
> CL-USER> (mapcar #'probe-file  (directory #P"/Volumes/CarryDaten/ 
> tobackup/Installer/Photoshop 7.0.1 Aktualisierung/*"))
> (#P"/Volumes/CarryDaten/tobackup/Installer/Photoshop 7.0.1 
> Aktualisierung/.DS_Store" NIL)
>
> i think mcl is correct on this:
>
> ? (directory #P"CarryDaten:tobackup:Installer:Photoshop 7.0.1 
> Aktualisierung:*")
> (#2P"CarryDaten:tobackup:Installer:Photoshop 7.0.1 Aktualisierung:.DS_Store"
> #P"CarryDaten:tobackup:Installer:Photoshop 7.0.1 Aktualisierung:\\¶.3 
> .loop")
>
> ? (mapcar #'probe-file (directory #P"CarryDaten:tobackup:Installer:Photoshop 
> 7.0.1 Aktualisierung:*"))
> (#2P"CarryDaten:tobackup:Installer:Photoshop 7.0.1 Aktualisierung:.DS_Store"
> #P"CarryDaten:tobackup:Installer:Photoshop 7.0.1 Aktualisierung:\\¶.3 
> .loop")
>


More information about the Openmcl-devel mailing list