I have a problem with a program I have written that parses files for the game "Morrowind".
If anyone is interested the repository is at http://bitbucket.org/eeeickythump/esper/
Basically the problem is with filenames that have a single quote in them. Common lisp's pathname functions seem to insist on mangling these filenames by removing the quote (which is a perfectly legal character in Windows filesystems).
Using Clozure CL 1.4 on WinXP: (because the program must run on windows)
Code: Select all
CL-USER> (probe-file "c:/Morrowind/Data Files/Beryl's_Head_Replacer_v1.0.esm") ; this is the actual filename
NIL
CL-USER> (probe-file #p"c:/Morrowind/Data Files/Beryl's_Head_Replacer_v1.0.esm")
NIL
CL-USER> (pathname "c:/Morrowind/Data Files/Beryl's_Head_Replacer_v1.0.esm")
#P"c:/Morrowind/Data Files/Beryls_Head_Replacer_v1'.0.esm" ; note the mangling of single quotes
CL-USER> (probe-file *)
NIL
CL-USER> (pathname "c:/Morrowind/Data Files/Beryl\'s_Head_Replacer_v1.0.esm")
#P"c:/Morrowind/Data Files/Beryls_Head_Replacer_v1'.0.esm"
CL-USER> (pathname "c:/Morrowind/Data Files/Beryl\\'s_Head_Replacer_v1.0.esm")
#P"c:/Morrowind/Data Files/Beryl/s_Head_Replacer_v1'.0.esm"
CL-USER> (pathname "c:/Morrowind/Data Files/Beryl''s_Head_Replacer_v1.0.esm") ; try 2 quotes
#P"c:/Morrowind/Data Files/Beryl''s_Head_Replacer_v1'.0.esm" ; this fails too