Question about wild-pathnames

Alan Ruttenberg alanruttenberg at gmail.com
Thu Jul 6 04:25:02 UTC 2023


It's not a wild pathname but it does satisfy wild-pathname-p. Given that
wild-pathname-p returns t, it is correct that an error is thrown
http://www.lispworks.com/documentation/HyperSpec/Issues/iss267_w.htm

You can address a file called "*" by quoting.
(wild-pathname-p "*") -> (:wild :wild-inferiors)
(wild-pathname-p "\\*") -> nil
(probe-file "~/*" ) throws an error
(probe-file "~/\\*")  works - I checked by creating a file called "*" in my
home directory.


Alan


On Wed, Jul 5, 2023 at 7:27 PM Robert Goldman <rpgoldman at sift.net> wrote:

> In SBCL and Allegro, it's possible for UIOP to create a pathname for a
> file whose name is "*" and then we can find a file with such a(n odd)
> pathname.
>
> On ABCL, though, this gives me an error:
>
> (truename (ensure-pathname "*"))
>
> (truename (uiop:ensure-pathname "*"))
> #<THREAD "interpreter" native {21C91F12}>: Debugger invoked on condition of type FILE-ERROR
>   Cannot find the TRUENAME for a wild pathname.
>
> But actually, I don't think this *is* a wild pathname:
>
> CL-USER(4): (describe (uiop:ensure-pathname "*"))
> #P"*" is an object of type PATHNAME:
>   HOST         NIL
>   DEVICE       NIL
>   DIRECTORY    NIL
>   NAME         "*"
>   TYPE         :UNSPECIFIC
>   VERSION      NIL
>
> *this* is a wild pathname:
>
> CL-USER(5): (describe (parse-namestring "*"))
> #P"*" is an object of type PATHNAME:
>   HOST         NIL
>   DEVICE       NIL
>   DIRECTORY    NIL
>   NAME         :WILD
>   TYPE         NIL
>   VERSION      NIL
>
> Is this an ABCL bug, since it means ABCL cannot address a file whose name
> is "*"?
>
> The interested may refer to this ASDF issue
> <https://gitlab.common-lisp.net/asdf/asdf/-/issues/140> and the
> corresponding merge request.
>
> Thanks!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20230706/8ad23336/attachment.html>


More information about the armedbear-devel mailing list