Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the trivial-file-size Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 06:03:11 2022 GMT+0.
Next: Systems, Previous: The trivial-file-size Reference Manual, Up: The trivial-file-size Reference Manual [Contents][Index]
This library exports a single function, file-size-in-octets
. It
returns the size of a file in bytes, using system calls when possible.
The canonical way to determine the size of a file in bytes, using
Common Lisp, is to open the file with an element type of
(unsigned-byte 8)
and then calculate the length of the stream. This
is less than ideal. In most cases it would be better to get the size
of the file from its metadata, using a system call.
This is a problem I have run into several times in several different projects. I want it solved, once and for all.
At the moment, getting the file size from metadata is supported for the following Lisps:
For other Lisps and platforms, we fall back to opening the file and
calling file-length
on the stream.
This library is as much a call to arms as it is a resource. If you know how to stat a file on your Common Lisp implementation, on your platform, please make a pull request -- or just open an issue to point me to the right documentation, and I'll do all the work.
Next: Files, Previous: Introduction, Up: The trivial-file-size Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Stat a file’s size.
Paul M. Rodriguez <pmr@ruricolist.com>
MIT
Next: Packages, Previous: Systems, Up: The trivial-file-size Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: trivial-file-size/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
trivial-file-size (system).
Next: trivial-file-size/trivial-file-size.lisp, Previous: trivial-file-size/trivial-file-size.asd, Up: Lisp [Contents][Index]
trivial-file-size (system).
Previous: trivial-file-size/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
trivial-file-size (system).
file-size-in-octets (function).
Next: Definitions, Previous: Files, Up: The trivial-file-size Reference Manual [Contents][Index]
Packages are listed by definition order.
common-lisp.
file-size-in-octets (function).
Next: Indexes, Previous: Packages, Up: The trivial-file-size Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Previous: Public Interface, Up: Public Interface [Contents][Index]
Return the size of FILE in octets.
Whenever possible, get the size from the file’s metadata.
Some platforms (e.g. ABCL) may return 0 when the file does not exist.
Previous: Public Interface, Up: Definitions [Contents][Index]
Previous: Ordinary functions, Up: Internals [Contents][Index]
Previous: Definitions, Up: The trivial-file-size Reference Manual [Contents][Index]
Jump to: | F |
---|
Jump to: | F |
---|
Jump to: | F P S T |
---|
Jump to: | F P S T |
---|