Discussion:
Directory and wild pathnames.
Mark Cox
2017-07-23 11:32:02 UTC
Permalink
G'day all,

The following code signals an error in ABCL 1.5.0 on OS X 10.10.5.

[1] CL-USER(1): (directory (merge-pathnames (make-pathname :directory
'(:relative :wild))
(user-homedir-pathname)))
#<THREAD "interpreter" {590C3415}>: Debugger invoked on condition of type
TYPE-ERROR
The value NIL is not of type (OR PATHNAME STRING FILE-STREAM
SYSTEM:JAR-STREAM SYSTEM:URL-STREAM).

Any help would be appreciated.

Thanks
Mark Cox
Mark Evenson
2017-07-24 07:31:26 UTC
Permalink
Post by Mark Cox
G'day all,
The following code signals an error in ABCL 1.5.0 on OS X 10.10.5.
[1] CL-USER(1): (directory (merge-pathnames (make-pathname :directory
'(:relative :wild))
(user-homedir-pathname)))
#<THREAD "interpreter" {590C3415}>: Debugger invoked on condition of type
TYPE-ERROR
The value NIL is not of type (OR PATHNAME STRING FILE-STREAM
SYSTEM:JAR-STREAM SYSTEM:URL-STREAM).
This is an a [bug in ABCL's implementation, needing fixing][451].

[451]: http://abcl.org/trac/ticket/451

As a workaround, you can use the (underdocumented) predicate
SYS::PATHNAME-DIRECTORY-P) like in the following kludge:

(loop :for p :in (directory (merge-pathnames "*" (user-homedir-pathname)))
:when (sys::pathname-directory-p p)
:collect p)
--
"A screaming comes across the sky. It has happened before, but there
is nothing to compare to it now."
Continue reading on narkive:
Loading...