Files
Opening and Closing Files
-
(open-input-filefilename) - Standard File Procedure. Open the specified file for reading. Returns an input port.
-
(open-output-filefilename) - Standard File Procedure. Open the specified file for writing. Returns an output port.
-
(close-input-portinput-port) - Standard File Procedure. Close an open input port. (It is an error to try to close something that is not an input port, or an input port that is already closed.)
-
(close-output-portoutput-port) - Standard File Procedure. Close an open output port. (It is an error to try to close something that is not an output port, or an output port that is already closed.)
Reading From Files
-
(readinput-port) - Standard File Procedure. Read the next value available on the specified port. If no characters remain, returns the end-of-file object.
-
(read-charinput-port) - Standard File Procedure. Read the next character available on the specified port. If no characters remain, returns the end-of-file object.
-
(peek-charinput-port) - Standard File Procedure. Determine the next character available on the specified port. If no characters remain, returns the end-of-file object.
Writing To Files
-
(displayvalueoutput-port) - Standard File Procedure.
Print a human-readable representation of
valueon the specified port. -
(writevalueoutput-port) - Standard File Procedure. Print the verbose representation of the specified value to the specified port.
-
(write-charchoutput-port) - Standard File Procedure. Write the the given character to the specified port.
-
(newlineoutput-port) - Standard File Procedure. Write a newline (carriage return) to the specified output port.
Predicates
-
(input-port?val) - Standard File Predicate.
Determine if
valis an open input port. -
(output-port?val) - Standard File Predicate.
Determine if
valis an open output port. -
(file-exists?filename) - Standard File Procedure. Determine whether a file with the given name exists.
-
(eof-object?val) - Standard File Procedure.
Determine if
valis something returned byread(orread-charorpeek-char) to indicate the end of input.
Miscellaneous
-
(delete-filefilename) - Common File Procedure. Delete the file specified by filename. If the file doesn't exist, reports an error.