Lisp HUG Maillist Archive

map over directory

Is there a function that would let me map over files in a directory?

	Thanks, Joel

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------


Re: map over directory

DIRECTORY will return a list of the files in a directory that match a particular path:

(let* ((wild (make-pathname :name :wild :type "txt" :defaults #P"/Users/temerson/"))
       (files (directory wild :directories nil)))
  (dolist (f files)
    (format t "~a~%" f)))

On Tue, Sep 27, 2011 at 11:29 AM, Joel Reymont <joelr1@gmail.com> wrote:

Is there a function that would let me map over files in a directory?

       Thanks, Joel

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------




--
Tom Emerson
tremerson@gmail.com
http://treerex.blogspot.com/

Re: map over directory

Hey Joel,


On 27 sept. 2011, at 17:29, Joel Reymont wrote:

> Is there a function that would let me map over files in a directory?

What about using this:

(mapcar #'namestring (directory "/"))

DIRECTORY returns a list of files in the specified pathname.
You can use MAPC instead of MAPCAR if you don't care about the result.



Best,
Cam


RE: map over directory

http://weitz.de/cl-fad/#walk-directory

Eivind

> -----Original Message-----
> From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com]
> On Behalf Of Joel Reymont
> Sent: 27. september 2011 17:29
> To: Lisp HUG
> Subject: map over directory
> 
> 
> Is there a function that would let me map over files in a directory?
> 
> 	Thanks, Joel
> 
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------


Re: map over directory

Woot!

On Tue, Sep 27, 2011 at 11:41 AM, Camille Troillard
<camille@osculator.net> wrote:
> Hey Joel,
>
> What about using this:
>
> (mapcar #'namestring (directory "/"))
>


-- 
--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------


Updated at: 2020-12-10 08:37 UTC