User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:file-length [2019/11/11 05:00]
cl:functions:file-length [2019/11/22 14:00] (current)
Line 1: Line 1:
 +====== Function FILE-LENGTH ======
 +
 +====Syntax====
 +  * **file-length** //stream// → //length//
 +
 +====Arguments and Values====
 +  * //stream// - a //​[[CL:​Glossary:​stream associated with a file]]//.
 +  * //length// - a non-negative //​[[CL:​Glossary:​integer]]//​ or **[[CL:​Constant Variables:​nil]]**.
 +
 +====Description====
 +**file-length** returns the length of //stream//, or **[[CL:​Constant Variables:​nil]]** if the length cannot be determined.
 +
 +For a binary file, the length is measured in units of the //​[[CL:​Glossary:​element type]]// of the //stream//.
 +
 +====Examples====
 +<​blockquote>​
 +([[CL:​Macros:​with-open-file]] (s "​decimal-digits.text"​ :direction :​output ​
 +                                         :​if-exists :​error) ​
 +  ([[CL:​Functions:​princ]] "​0123456789"​ s) 
 +  ([[CL:​Functions:​truename]] s)) → #​P"​A:>​Joe>​decimal-digits.text.1" ​
 +([[CL:​Macros:​with-open-file]] (s "​decimal-digits.text"​) ​
 +  (file-length s)) → 10
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +Should signal an error of type type-error if //stream// is not a //​[[CL:​Glossary:​stream associated with a file]]//.
 +
 +====See Also====
 +  8 **[[CL:​Functions:​open|Function OPEN]]**
 +
 +====Notes====
 +None.
 +