next up previous
Next: 2.11 Opening Streams Over File Descriptors Up: 2. Environmentally Friendly I/O Previous: 2.9 Open Compatibility

  
2.10 Automatically Opened Files

Files are automatically opened in `r' or `w' mode if a stream input or output operation is initiated on a previously unmentioned name. For an auto-opened input file, when an end-of-file condition is sensed, the stream is auto-closed. The only routine which auto-closes a stream that was auto-opened for output is putfile, making it a partner to getfile in using the environmental filesystem as an elementary persistent database.

In order to discover whether a particular stream is open (either as a result of automatic opening or a successful open call), the boolean-valued expression *

is_open f
can be applied to a filename or file descriptor f without causing any side-effects such as the setting of last_error.


next up previous
Next: 2.11 Opening Streams Over File Descriptors Up: 2. Environmentally Friendly I/O Previous: 2.9 Open Compatibility
David Bacon
1999-12-10