From: Jimmy Miller
Subject: Listing Subdirectories
Date: 
Message-ID: <c20b776c-a419-4bb2-8047-c3a0239019cb@p25g2000hsf.googlegroups.com>
To the best of my knowledge, the DIRECTORY function is supposed to
list all files and subdirectories found within a given directory.
However, when I do something like

(directory #P"C:\\*")

I get a list of all the files in C:\, but none of the subdirectories.
I've tried using a double-asterisk as the wildcard as well, but that
doesn't work either.

Is this behavior due to the fact that I'm running on Windows?  Is
there any way I can list all the subdirectories within a given
directory?

From: Pascal Bourguignon
Subject: Re: Listing Subdirectories
Date: 
Message-ID: <87hceppvat.fsf@thalassa.informatimago.com>
Jimmy Miller <··············@gmail.com> writes:

> To the best of my knowledge, the DIRECTORY function is supposed to
> list all files and subdirectories found within a given directory.
> However, when I do something like
>
> (directory #P"C:\\*")
>
> I get a list of all the files in C:\, but none of the subdirectories.
> I've tried using a double-asterisk as the wildcard as well, but that
> doesn't work either.
>
> Is this behavior due to the fact that I'm running on Windows?  Is
> there any way I can list all the subdirectories within a given
> directory?

This is highly implementation specific, but if you try: 

   (pathname-directory #P"C:\\*")

you'll see that the wildcard is not on the directory part.

Contrast it with:

   (pathname-directory #P"C:\\*\\")

At least, that's what we see on clisp/linux:

C/USER[45]> (directory #P"/*")
NIL
C/USER[46]> (directory #P"/*/")
(#P"/dev/" #P"/tmp/" #P"/sys/" #P"/boot/" #P"/var/" #P"/bin/"
 #P"/media/" #P"/home/" #P"/sbin/" #P"/mnt/" #P"/lib/" #P"/etc/" #P"/usr/"
 #P"/lost+found/" #P"/root/" #P"/opt/")
C/USER[47]> (pathname-directory #P"/*/")
(:ABSOLUTE :WILD)
C/USER[48]> (pathname-directory #P"/*")
(:ABSOLUTE)
C/USER[49]> 

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

ADVISORY: There is an extremely small but nonzero chance that,
through a process known as "tunneling," this product may
spontaneously disappear from its present location and reappear at
any random place in the universe, including your neighbor's
domicile. The manufacturer will not be responsible for any damages
or inconveniences that may result.
From: Jimmy Miller
Subject: Re: Listing Subdirectories
Date: 
Message-ID: <e7c6e530-1f00-4113-98e9-5941bb3ca9a3@e39g2000hsf.googlegroups.com>
On Mar 29, 7:30 am, Pascal Bourguignon <····@informatimago.com> wrote:
> Jimmy Miller <··············@gmail.com> writes:
> > To the best of my knowledge, the DIRECTORY function is supposed to
> > list all files and subdirectories found within a given directory.
> > However, when I do something like
>
> > (directory #P"C:\\*")
>
> > I get a list of all the files in C:\, but none of the subdirectories.
> > I've tried using a double-asterisk as the wildcard as well, but that
> > doesn't work either.
>
> > Is this behavior due to the fact that I'm running on Windows?  Is
> > there any way I can list all the subdirectories within a given
> > directory?
>
> This is highly implementation specific, but if you try:
>
>    (pathname-directory #P"C:\\*")
>
> you'll see that the wildcard is not on the directory part.
>
> Contrast it with:
>
>    (pathname-directory #P"C:\\*\\")
>
> At least, that's what we see on clisp/linux:
>
> C/USER[45]> (directory #P"/*")
> NIL
> C/USER[46]> (directory #P"/*/")
> (#P"/dev/" #P"/tmp/" #P"/sys/" #P"/boot/" #P"/var/" #P"/bin/"
>  #P"/media/" #P"/home/" #P"/sbin/" #P"/mnt/" #P"/lib/" #P"/etc/" #P"/usr/"
>  #P"/lost+found/" #P"/root/" #P"/opt/")
> C/USER[47]> (pathname-directory #P"/*/")
> (:ABSOLUTE :WILD)
> C/USER[48]> (pathname-directory #P"/*")
> (:ABSOLUTE)
> C/USER[49]>

Thank you, including the trailing \\ works.  This has been the
solution to several of my pathname problems now; I'll have to remember
it from now on.
From: Luís Oliveira
Subject: Re: Listing Subdirectories
Date: 
Message-ID: <877iflfwz9.fsf@deadspam.com>
Jimmy Miller <··············@gmail.com> writes:

> To the best of my knowledge, the DIRECTORY function is supposed to
> list all files and subdirectories found within a given directory.
> However, [...]

Pascal has identified the problem with your code but have a look at
CL-FAD: <http://www.weitz.de/cl-fad/>. You might find it useful.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
From: ·············@gmail.com
Subject: Re: Listing Subdirectories
Date: 
Message-ID: <04a1a215-5ec1-4582-a8dd-9113dc810176@s50g2000hsb.googlegroups.com>
On Mar 29, 7:23 am, Jimmy Miller <··············@gmail.com> wrote:
> To the best of my knowledge, the DIRECTORY function is supposed to
> list all files and subdirectories found within a given directory.
> However, when I do something like
>
> (directory #P"C:\\*")
>
> I get a list of all the files in C:\, but none of the subdirectories.
> I've tried using a double-asterisk as the wildcard as well, but that
> doesn't work either.

http://clisp.cons.org/impnotes/faq.html#faq-other-problem
http://clisp.cons.org/impnotes/file-dict.html#directory