| Allegro CL version 6.2 This page is new in 6.2 |
Arguments: stream
This function queries the stream's external-format to obtain information on the end-of-line convention being used. It returns two values: a symbol indicating the end-of-line convention and an external-format.
The first returned value is one of the following values:
:dos
: stream's external format
is a composed external format with a DOS-style end-of-line convention
(carriage-return linefeed at the end of each line).
:mac
: stream's external format
is a composed external format with a Macintosh-style end-of-line convention
(carriage-return but no linefeed at the end of each line).
:unix
: stream's external
format is not a composed external format and has a UNIX-style
end-of-line convention (linefeed but no carriage return).
If stream's external format is not a composed
external format (i.e. the first returned value is
:unix
), stream's external
format is returned as the second return value. If
stream's external format is a composed external
format, the second returned is the composee (which translates Lisp
characters to octets) external format. This allows easy construction
of a new composed external format based on
stream's, if desired. Composed external formats
are described in Composed External-Formats.
You can change the end-of-line convention using setf and this function. Specify one of the
keywords :unix
, :dos
, or
:mac
as the new value.
[On Windows] (setq s (open "c:/autoexec.bat")) -> stream ;; The stream is currently set to read/write Ascii 13 followed by Ascii 10 ;; as/for #\newline. (eol-convention s) -> :dos #<external-format ...> ;; Set the stream so that it reads/writes Ascii 13 as/for #\newline (setf (eol-convention s) :mac) -> :mac #<external-format ...> ;; Set the stream so that it reads/writes Ascii 10 as/for #\newline (setf (eol-convention s) :unix) -> :unix #<external-format ...> [On Unix] (setq s (open "/etc/passwd")) ;; The stream is currently set to read/write Ascii 10 as/for #\newline (eol-convention s) -> :unix #<external-format ...> ;; Set the stream so that it reads/writes Ascii 13 followed by ;; Ascii 10 as/for #\newline. (setf (eol-convention s) :dos) -> :dos #<external-format ...> ;; Set the stream so that it reads/writes Ascii 13 as/for #\newline (setf (eol-convention s) :mac) -> :mac #<external-format ...>
See also #\newline discussion.
Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. This page is new in the 6.2 release.
Created 2002.2.26.
| Allegro CL version 6.2 This page is new in 6.2 |