From: Gary Brown
Subject: Getting File System Information From LISP
Date: 
Message-ID: <10hi78dcvh9df7f@corp.supernews.com>
Hi,

I have the free version of LispWorks.  How do I get file system
information -
the equivalent of FindFirstFile/FindNextFile for MS Windows?  Specifically,
I need file size which doesn't appear to have a standard LISP function.

Thanks,
Gary

From: Carl Shapiro
Subject: Re: Getting File System Information From LISP
Date: 
Message-ID: <ouyy8kmeivs.fsf@panix3.panix.com>
"Gary Brown" <··········@charter.net> writes:

> I have the free version of LispWorks.  How do I get file system
> information -
> the equivalent of FindFirstFile/FindNextFile for MS Windows?  Specifically,
> I need file size which doesn't appear to have a standard LISP function.

There is nothing equivalent to FindFirstFile or FindNextFile in Common
Lisp.  You can simulate their intended behavior by iterating over the
values returned by the standard function DIRECTORY which can enumerate
the contents of a directory.  If you wish to determine the file size
of the files returned you should then apply the FILE-LENGTH function
to the pathnames objects returned by DIRECTORY.

Another option is to write FLI bindings for FindFirstFile,
FindNextFile, and the WIN32_FIND_DATA structure.  If you are doing a
lot of system programming I would sincerely encourage you to learn how
to use the LispWorks FLI (which is one of the better foreign-function
interfaces out there).  Using the FLI you can make the complete Win32
API available to your Lisp application.
From: Edi Weitz
Subject: Re: Getting File System Information From LISP
Date: 
Message-ID: <87ekmehkma.fsf@bird.agharta.de>
On Tue, 10 Aug 2004 15:08:34 -0400, "Gary Brown" <··········@charter.net> wrote:

> I have the free version of LispWorks.  How do I get file system
> information - the equivalent of FindFirstFile/FindNextFile for MS
> Windows?  Specifically, I need file size which doesn't appear to
> have a standard LISP function.

I don't know about FindFirstFile/FindNextFile but have you checked
FILE-LENGTH? It's a standard CL function.

Edi.

-- 

"Lisp doesn't look any deader than usual to me."
(David Thornley, reply to a question older than most languages)

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Gary Brown
Subject: Re: Getting File System Information From LISP
Date: 
Message-ID: <10hie7540s2663a@corp.supernews.com>
> > I have the free version of LispWorks.  How do I get file system
> > information - the equivalent of FindFirstFile/FindNextFile for MS
> > Windows?  Specifically, I need file size which doesn't appear to
> > have a standard LISP function.

> I don't know about FindFirstFile/FindNextFile but have you checked
> FILE-LENGTH? It's a standard CL function.

Interesting.  Xanalys doesn't list it in "The File Dictionary" so I
missed it.  It is in the "Master Index."  I still need some of the other
file information that isn't listed.

Thanks,
Gary
From: Edi Weitz
Subject: Re: Getting File System Information From LISP
Date: 
Message-ID: <871xie1yh1.fsf@bird.agharta.de>
On Tue, 10 Aug 2004 17:07:59 -0400, "Gary Brown" <··········@charter.net> wrote:

> Interesting.  Xanalys doesn't list it in "The File Dictionary" so I
> missed it.

You're talking about the HyperSpec? It's in the "Streams Dictionary."

-- 

"Lisp doesn't look any deader than usual to me."
(David Thornley, reply to a question older than most languages)

Real email: (replace (subseq ·········@agharta.de" 5) "edi")