Re: Is there an efficient way to get file length w/o reading file?



Jeffrey Cunningham <jeffrey.k.cunningham@xxxxxxxxxx> writes:

> I started to wonder if it was possible to do this in CL without
> having to actually read each file to determine it's length.

Have you considered FILE-LENGTH?

I've used something like the following:

(defun file-length-in-bytes (file)
(with-open-file (stream file :direction :input
:element-type '(unsigned-byte 8))
(file-length stream)))

Zach
.