| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.14.10.2 File Options
When opening a file, the various procedures in this library accept a
file-options object that encapsulates flags to specify how the
file is to be opened. A file-options object is an enum-set
(see section rnrs enums) over the symbols constituting valid file options.
A file-options parameter name means that the corresponding argument must be a file-options object.
- Scheme Syntax: file-options file-options-symbol ...
-
Each file-options-symbol must be a symbol.
The
file-optionssyntax returns a file-options object that encapsulates the specified options.When supplied to an operation that opens a file for output, the file-options object returned by
(file-options)specifies that the file is created if it does not exist and an exception with condition type&i/o-file-already-existsis raised if it does exist. The following standard options can be included to modify the default behavior.no-createIf the file does not already exist, it is not created; instead, an exception with condition type
&i/o-file-does-not-existis raised. If the file already exists, the exception with condition type&i/o-file-already-existsis not raised and the file is truncated to zero length.no-failIf the file already exists, the exception with condition type
&i/o-file-already-existsis not raised, even ifno-createis not included, and the file is truncated to zero length.no-truncateIf the file already exists and the exception with condition type
&i/o-file-already-existshas been inhibited by inclusion ofno-createorno-fail, the file is not truncated, but the port’s current position is still set to the beginning of the file.
These options have no effect when a file is opened only for input. Symbols other than those listed above may be used as file-options-symbols; they have implementation-specific meaning, if any.
Note: Only the name of file-options-symbol is significant.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.
