Re: Directory and wild pathnames.

Mark Evenson <[email protected]>
Newsgroups gmane.editors.j.devel
Message-ID <[email protected]>

On 7/23/17 13:32, Mark Cox wrote:
> 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."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.