What about adding a better FILE-LENGTH function to UIOP?
I was looking at Peter Seibel's discussion of FILE-LENGTH in PCL. PiTA, and certainly unsuitable for use if one wants to write scripts in CL.
What about making UIOP:FILE-LENGTH be generic and take either strings (filenames), pathnames, or streams as argument?
cheers, r
On Mon, Nov 23, 2015 at 12:14 PM, Robert Goldman rpgoldman@sift.net wIrote:
What about adding a better FILE-LENGTH function to UIOP?
I was looking at Peter Seibel's discussion of FILE-LENGTH in PCL. PiTA, and certainly unsuitable for use if one wants to write scripts in CL.
What about making UIOP:FILE-LENGTH be generic and take either strings (filenames), pathnames, or streams as argument?
Such a function probably fits in the library, though a bit less so if it is *not* used by ASDF.
Please don't use a name that clashes with the CL package. The ASDF and UIOP tradition seems to suggest such a function should be named FILE-LENGTH*.
I believe :element-type '(unsigned-byte 8) should be the default.
I can review such a change that you write, or, if you're confident, you can just push the change and I can fix anything I don't like about it.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org If you think health care is expensive now, wait until you see what it costs when it's free. — P.J. O'Rourke
Faré fahree@gmail.com writes:
What about making UIOP:FILE-LENGTH be generic and take either strings (filenames), pathnames, or streams as argument?
Such a function probably fits in the library, though a bit less so if it is *not* used by ASDF.
Please don't use a name that clashes with the CL package. The ASDF and UIOP tradition seems to suggest such a function should be named FILE-LENGTH*.
Or FILE-SIZE
If you want to determine a "size" of a file without opening it (and counting newlines), then you're not considering a length (of a sequence, stored in the stream), but a file system file size.
There's ql-util:file-size