[previous] [up] [next]     [contents] [index]
Next: Pipes Up: Ports Previous: Current Ports

Opening File Ports

The open-input-file and open-output-file procedures accept an optional flag argument after the filename that specifies a mode for the file:

The open-output-file procedure can also take a flag argument that specifies how to proceed when a file with the specified name already exists:

Extra flag arguments are passed to open-output-file in any order. Appropriate flag arguments can also be passed as the last argument(s) to call-with-input-file, with-input-from-file, call-with-output-file, and with-output-to-file. When conflicting flag arguments (e.g., both 'error and 'replace) are provided to open-output-file, with-output-to-file, or call-with-output-file, the exn:application:mode-conflict exception is raised.

When an input or output file port is created, it is placed into the management of the current custodian (see section 9.5).


[previous] [up] [next]     [contents] [index]
Next: Pipes Up: Ports Previous: Current Ports

PLT