[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another open file/size question.

Okay, I'd like to get file sizes that are the same as what the finder
dumps out.  Using code from bill@cambridge.apple.com:

(defun file-size (pathname)
  (with-open-file (stream pathname)
    (file-length stream)))

I get numbers less that what the finder reports.  I believe this is a
result of possibly two things:

1) file-length reports the EOF for the data, while the finder uses the
EOF for the file (since space is allocated in blocks, which may not be
filled) -- I forget the official IM terminology.

2) open-file only opens the data fork and thus file-length doesn't
include the resource fork size.

Which leads to the question:

How does one open the resource (data) fork specifically?

and the point of this post is:

How do I get lisp code to give me the same size that the finder does?

Thanks again, sorry to bother, but I'm new here.

| James Schultz               | "Childhood is short and
| Carnegie Mellon University  |  maturity is forever."
| js3b+@andrew.cmu.edu        |           -- Calvin & Hobbes