[Openmcl-devel] Problem with wild-inferiors directory list and pathname with a single quote in it
kalman.reti at gmail.com
Sun Jul 25 12:28:55 UTC 2010
I forgot to mention, I was testing this on the trunk. (I don't think
On Sun, Jul 25, 2010 at 8:21 AM, Kalman Reti <kalman.reti at gmail.com> wrote:
> Doing a wild-inferiors directory call on a directory one of whose
> children directories
> has a file whose name contains a single quote errors out.
> I've investigated the proximate cause of this.
> In %ccl::%all-directories, when you get an entry from %read-dir that is a
> pathname which has a single quote as part of the name, you have the
> correct [as in what's on disk] name+type string in the variable sub,
> but then later you do
> (multiple-value-bind (name type) (%std-name-and-type sub)
> (setq ans (%cons-pathname (or dir-list (setq dir-list
> (reverse so-far)) name type nil device))
> which creates a pathname in the variable ans with a doubled (i.e.
> quoted) single quote.
> (Most likely that file with the doubled quote doesn't exist; even if
> it does, this is not the
> file you were looking for!)
> It appears that the intent is that pathnames for such files always
> have the single quote doubled,
> so perhaps it is the sub value which is wrong.
> This is easy to reproduce. The way I did it is to create c:/foo1/
> then c:/foo1/goo1 and then,
> outside of openmcl, create a file called "test'it.jpg" (without the
> double-quotes but with the
> embedded single quote) in c:/foo1/goo1/.
> (directory "c:/foo1/**/*.jpg")
> fails complaining thusly:
>> Error: File #P"c:/foo1/goo1/test''it.jpg" does not exist.
> There are probably other confusions of a similar sort lurking around.
> If you then add a file
> called testit.jpg to that same directory and do
> (directory "c:/foo1/goo1/*.jpg")
> you get a surprising result!
> (I originally encountered this problem while trying to find all the
> jpg files on my local disk
> on which some third-party video editing software had installed a file
> called "You're a star.jpg".)
More information about the Openmcl-devel