"Tim Daly Jr." <tim@...> writes:
> On Wed, 2005-11-23 at 14:18 -0500, Michael Price wrote:
>> On 11/23/05, Tim Daly Jr. <tim@...> wrote:
> ...
>> > You can escape the [, but then the namestring ends up with a backslash
>> > in it: (namestring #p"/tmp/\\[P]foo") => "/tmp/\\[P]foo".
>>
>> What about this:
>>
>> $ touch "[P]file"
>> $ ls \[P\]*
>> [P]file
>> $ sbcl
>> CL-USER> (directory #p"/tmp/\[P]*")
>>
>> (#P"/tmp/\\[P]file")
>
> Right. Now there's a backslash in the namestring of that pathname,
> which makes it less useful for, e.g., handing to unix system calls.
> (Which is, IMHO, not such a silly thing to want to do...)
This is why God^WThe SBCL Development Team gave us sb-posix.
In general, Lisp namestrings are not Unix pathnames; no need to go as
far as #\[ characters: you'll see the same effect with files with a
Unix pathname containing #\*.
The pattern matching in DIRECTORY does indeed look broken, though, but
what's _meant_ to happen with your namestring "[P]*.*" is that it
would match all files beginning with an uppercase P.
Cheers,
Christophe
|