|ext:make-eol-conversion-stream stream &key input output close-stream-p buffering in-buffer-size out-buffer-size mode pathname||[Function]|
Create an end-of-line conversion stream that reads or writes the given character stream and can convert between the Common Lisp convention of a single linefeed character for line termination and both the DOS convention of a carriage-return and linefeed sequence and the Mac convention of a single carriage-return character. The input stream must be buffered with a buffer length of at least two characters.
The functions file-position and file-length are fully supported on all end-of-line conversion streams when the mode is :unix or :mac and when the encapsulated binary stream also supports these functions, are are also supported when the eol-of-line conversion stream is a file input stream. However when the mode is :dos the end-of-line conversion stream is not a file input stream then file-length is not supported and file-position has only limited support for positioning to the start or end of the file. The position and length of character streams are measured in units of characters, and determining the position within a file using the :dos mode requires reading the file to count the number of characters. So if the file-length is needed or the file-position is being changed on an output file using the :dos mode then the file must also be opened for input. Overwriting a file is permitted but may change the file length or leave the file with inconsistent end-of-line terminations.
- If true, allow input operations. This is the default if neither :input or :output is specified.
- If true, allow output operations.
- If true then the target stream is closed when this stream is closed.
- Either: :unix which maintains the linefeed characters as the end of line terminator, :dos to convert between linefeed characters and a carriage-return and linefeed character sequence, :mac to convert between a linefeed character and a carriage-return character, or :any-input to read any of these conventions as a linefeed but this is only possible on input only stream. The default is the :unix mode.
- Indicates the kind of output buffer flushing to use which may be one of: :none, :line, or the default :full. Note that non-blocking writes will not wait until all buffered output has been written, so the :none and :line buffer options are not reliable when used with non-blocking writes.
- When true, the returned stream will be a subclass of the class file-stream. This should generally be true if the stream is a file-stream.