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!
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@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!
Le 06/07/2023 à 01:26, Robert Goldman a écrit :
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. |
We use DIRECTORY to resolve wild pathnames:
(length (directory (uiop:ensure-pathname "*"))) ; --> 47
armedbear-devel@common-lisp.net