Opening and Closing Files

CLtL2 Reference 

function OPEN-TEXT : (filename direction)
Attempts to open the file FILENAME. If successful, returns an 8-bit character text stream. If DIRECTION is :input, then input operations can be performed on the stream. If DIRECTION is output, then output is directed to the file FILENAME, overwriting any existing file. If DIRECTION is :append, then output is appended to the file. For either output case, a new file is created if no file named FILENAME already exists. 

function OPEN-BINARY : (filename direction)
Attempts to open the file FILENAME. If successful, returns an 8-bit binary byte stream. If DIRECTION is :input, then input operations can be performed on the stream. If DIRECTION is output, then output is directed to the file FILENAME, overwriting any existing file. If DIRECTION is :append, then output is appended to the file. For either output case, a new file is created if no file named FILENAME already exists. 

macro WITH-TEXT-FILE : ((stream filestring direction) &body body)
In the scope of a WITH-TEXT-FILE expression, the file FILESTRING is opened for character i/o and a stream to this file is created and bound to the variable STREAM. If DIRECTION is :input, then input operations can be performed on STREAM. If DIRECTION is :output, then output operations can be performed, overwriting any existing file. If DIRECTION is :append, then output is appended to an existing file. 

macro WITH-BINARY-FILE : ((stream filestring direction) &body body)
In the scope of a WITH-BINARY-FILE expression, the file FILESTRING is opened for binary i/o and a stream to this file is created and bound to the variable STREAM. If DIRECTION is :input, then input operations can be performed on STREAM. If DIRECTION is :output, then output operations can be performed, overwriting any existing file. If DIRECTION is :append, then output is appended to an existing file.