File Operations on Open and Closed Streams (original) (raw)

ANSI Common Lisp 20 Files 20.1 File System Concepts

20.1.2 File Operations on Open and Closed Streams

Many functions that perform file operations accept either_open_ or closed streams as arguments; see Section 21.1.3 Stream Arguments to Standardized Functions.

Of these, the functions in the next figure treat open and closed streams differently.

File Functions that Treat Open and Closed Streams Differently

delete-file file-author probe-file
directory file-write-date truename

Since treatment of open streams by the file systemmay vary considerably between implementations, however, a closed stream might be the most reliable kind ofargument for some of these functions - in particular, those in the next figure. For example, in some file systems, open files are written under temporary names and not renamed until _closed_and/or are held invisible until closed. In general, any code that is intended to be portable should use such functions carefully.

File Functions where Closed Streams Might Work Best

directory probe-file truename