Runtime determination of share directories?



Camm Maguire wrote:
> Greetings!
>
> Robert Dodier <robert.dodier at gmail.com> writes:
>
>   
>> On 1/22/09, Raymond Toy <toy.raymond at gmail.com> wrote:
>>
>>     
>>>  Wouldn't it be nicer if we could do this at startup and just find all of
>>>  the directories in share directory?  Then we wouldn't have to maintain
>>>  this list at all, and users can easily add share packages themselves and
>>>  have them automatically available.  (Well, perhaps we could keep a few
>>>  of the core share packages in the list, but most would be determined at
>>>  runtime).
>>>       
>> Yes, that's a good idea. Have at it!
>>
>>     
>>>  I played with this a while back, but never finished it.  I think,
>>>  however, that all of the lisps we support can do this using the Lisp
>>>  DIRECTORY function with a bit of extra glue to return the right stuff.
>>>  GCL might be a bit more difficult, but I think it can be done there too.
>>>       
>> I believe it is within the realm of possibility that we might stop
>> working around GCL's idiosyncrasies.
>>
>>     
>
> It would be helpful if you could describe what 'idiosyncrasies' you
> find onerous, and perhaps suggest what type of behavior would be
> optimal.  

Hi Camm!

For me, I would like to have DIRECTORY return a list of the files in the
given directory and all subdirectories in the given directory.  

A working ensure-directories-exist would also be nice.  Right now, I
just call system to run mkdir -p.  That only works on Unix systems with
mkdir -p.

Or alternatively, I'd like some example of how to call C functions from
Lisp.  I tried to write an interface to mkdir(2), but nothing I've tried
actually works.

Ray