Prev: Tramadol no prescription usa fedex shipping ,buy Tramadol over the counter cod overnight,Tramadol purchased online without prescription,buying Tramadol over the counter for saleTramadol shipped cash on delivery
Next: USOCKET::%SETUP-WAIT-LIST is undefined.
From: Haris Bogdanovi� on 25 Jun 2010 14:24 How to go through a folder and collect all subfolder names as strings into a list ? Thanks
From: Jorge Gajon on 25 Jun 2010 14:47 On 2010-06-25, Haris Bogdanovi� <fbogdanovic(a)xnet.hr> wrote: > How to go through a folder and collect > all subfolder names as strings into a list ? > You should read chapters 14 and 15 of Peter Seibel's "Practical Common Lisp". http://gigamonkeys.com/book/ -- Jorge Gajon Mexico City http://gajon.org
From: Pascal J. Bourguignon on 25 Jun 2010 14:49 "Haris Bogdanovi�" <fbogdanovic(a)xnet.hr> writes: > How to go through a folder and collect > all subfolder names as strings into a list ? (mapcar (lambda (path) (first (last (pathname-directory path)))) (directory "folder/*/")) -- __Pascal Bourguignon__ http://www.informatimago.com/
From: Andrew Main on 25 Jun 2010 19:08 On 26/06/2010 6:24 a.m., Haris Bogdanovi� wrote: > How to go through a folder and collect > all subfolder names as strings into a list ? > > Thanks > With cl-fad (http://weitz.de/cl-fad/) installed, do: (use-package 'cl-fad) (defun subdirs (dir) (remove-if-not #'directory-pathnaname-p (list-directory dir))) then (subdirs some-directory) => a list of directories in some-directory Andrew
From: Andrew Main on 25 Jun 2010 19:16
On 26/06/2010 11:08 a.m., Andrew Main wrote: > On 26/06/2010 6:24 a.m., Haris Bogdanovi� wrote: >> How to go through a folder and collect >> all subfolder names as strings into a list ? >> >> Thanks >> > > > With cl-fad (http://weitz.de/cl-fad/) installed, do: > > (use-package 'cl-fad) > > (defun subdirs (dir) > (remove-if-not #'directory-pathnaname-p (list-directory dir))) > > then (subdirs some-directory) => a list of directories in some-directory > > Andrew Sorry, that will get you a list of pathnames. I'm not sure what the best way to turn that into a list of strings is, but mapping princ-to-string across that list would work. But first, make sure that whatever you're doing with the results actually needs strings and can't be done with a pathname. Andrew |