[Ecls-list] Getting directory contents on Unix

Pascal J. Bourguignon pjb at informatimago.com
Thu Mar 3 11:18:58 UTC 2011


"Duong \"Yang\" Ha Nguyen"
<cmpitg at gmail.com> writes:

> On Tue, 1 Mar 2011, Zach Beane wrote:
>
>> Say I have a directory structure like this:
>>
>>   /tmp/x/a.txt
>>   /tmp/x/b.txt (a symlink to a.txt)
>>
>> Is there any function I can call to get a list of #p"/tmp/x/a.txt" and
>> #p"/tmp/x/b.txt? On sbcl, for example, I can pass :resolve-symlinks nil
>> to CL:DIRECTORY. What (if anything) can I use in ECL?
>
> Not sure I understand what you need but have you tried Peter Seibel's
> CL-FAD (CL-FAD:LIST-DIRECTORY)?

The problem is that CL:DIRECTORY is specified to apply TRUENAME which is
specified to resolve symbolic links.  (See section 20.1.3 Truenames).

There is no conforming way to obtain the pathname of a symbolic link in
CL.  You have to use an extension, either an implementation specific
keyword argument to DIRECTORY, or an implementation specific function.



On POSIX systems, I'd advise to use the POSIX API thru CFFI to deal with
the POSIX file systems.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.





More information about the ecl-devel mailing list