FunctionPackage: exclToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
This page is new in 6.2

eol-convention

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:

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.

Examples

[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.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
This page is new in 6.2