I need to find a file for which I don't know the full path. I just
have the filename and the root directory. Before I start writing a
function to loop recursively over the subdirectories using probe-file,
is there a standard function that will do this? Preferably portable to
different OS?
Thanks a lot for any tips.
From: Edi Weitz
Subject: Re: Finding a file in a subdirectory
Date:
Message-ID: <uod8bpjz9.fsf@agharta.de>
On Tue, 15 Apr 2008 01:59:49 -0700 (PDT), ············@hotmail.com wrote:
> I need to find a file for which I don't know the full path. I just
> have the filename and the root directory. Before I start writing a
> function to loop recursively over the subdirectories using
> probe-file, is there a standard function that will do this?
> Preferably portable to different OS?
Not a standard function but maybe helpful in your case:
http://weitz.de/cl-fad/#walk-directory
Edi.
--
European Common Lisp Meeting, Amsterdam, April 19/20, 2008
http://weitz.de/eclm2008/
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
On Apr 15, 11:04 am, Edi Weitz <········@agharta.de> wrote:
> On Tue, 15 Apr 2008 01:59:49 -0700 (PDT), ············@hotmail.com wrote:
> > I need to find a file for which I don't know the full path. I just
> > have the filename and the root directory. Before I start writing a
> > function to loop recursively over the subdirectories using
> > probe-file, is there a standard function that will do this?
> > Preferably portable to different OS?
>
> Not a standard function but maybe helpful in your case:
>
> http://weitz.de/cl-fad/#walk-directory
>
> Edi.
>
> --
>
> European Common Lisp Meeting, Amsterdam, April 19/20, 2008
>
> http://weitz.de/eclm2008/
>
> Real email: (replace (subseq ·········@agharta.de" 5) "edi")
Thanks, it's just what I was looking for. As a side comment, looking
at the library I am just amazed that CL didn't include these functions
by default in the standard, and instead one needs to write this
sophisticated library to obtain some rather basic functions.
P� Tue, 15 Apr 2008 14:17:48 +0200, skrev <············@hotmail.com>:
> On Apr 15, 11:04 am, Edi Weitz <········@agharta.de> wrote:
>> On Tue, 15 Apr 2008 01:59:49 -0700 (PDT), ············@hotmail.com
>> wrote:
>> > I need to find a file for which I don't know the full path. I just
>> > have the filename and the root directory. Before I start writing a
>> > function to loop recursively over the subdirectories using
>> > probe-file, is there a standard function that will do this?
>> > Preferably portable to different OS?
>>
>> Not a standard function but maybe helpful in your case:
>>
>> http://weitz.de/cl-fad/#walk-directory
>>
>> Edi.
>>
>> --
>>
>> European Common Lisp Meeting, Amsterdam, April 19/20, 2008
>>
>> http://weitz.de/eclm2008/
>>
>> Real email: (replace (subseq ·········@agharta.de" 5) "edi")
>
> Thanks, it's just what I was looking for. As a side comment, looking
> at the library I am just amazed that CL didn't include these functions
> by default in the standard, and instead one needs to write this
> sophisticated library to obtain some rather basic functions.
Lisp does provide the functions.
Appart from walk directory all the functions have a equivalent in CL.
CL-FAD is just a thin compatabillity layer over some wrinkles that exist
in the CL functions.
See www.gigamonkeys.com/book chapters 14 and 15
--------------
John Thingstad
············@hotmail.com writes:
> I need to find a file for which I don't know the full path. I just
> have the filename and the root directory. Before I start writing a
> function to loop recursively over the subdirectories using probe-file,
> is there a standard function that will do this? Preferably portable to
> different OS?
> Thanks a lot for any tips.
I would do:
(directory (merge-pathnames (make-pathname :directory '(:relative :wild-inferiors)
:name (pathname-name filename)
:type (pathname-type filename))
root-directory nil))
--
__Pascal Bourguignon__