read_line (file)
A file pointer to a previously opened file. This may be either a file in the file system, or a string opened for read and write.
All characters in the file up to the first newline character, as a string. If the end of file is reached, returns "Unexpected end of file".
This function reads a single line of text from the given file, up to the first newline character, regardless of Lisp syntax. This allows a programmer to deal with text files constructed by other programs.
An input file contains the following:
Lists can be expressed as (a b c).
Successive calls to read_line will produce:
Gamma> ft = open ("myreadlfile.dat", "r"); #<File:"myreadlfile.dat"> Gamma> read_line(ft); "Lists can be" Gamma> read_line(ft); "expressed as (a b c)." Gamma> read_line(ft); "Unexpected end of file" Gamma>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.