This chapter lists some useful functions for file input / output. Please note that most functions you might expect to find here (like opening and reading from a regular file) are already part of S-lang itself. If you need one of those, please consult the file slangfun.txt which comes with S-lang.
Void close_log_file ()
The close_log_file
function closes the file previously opened
by open_log_file
.
open_log_file, log_message
Void log_message (String_Type msg)
The log_message
function may be used to write a string to the
log file. If no log file has been opened via open_log_file
,
the message will be written to stderr
.
open_log_file, close_log_file, message
String_Type make_home_filename (String_Type name)
This function returns the complete filename associated with a file called
name
located in the user's home directory. If name
is already
an absolute filename or explicitly relative to the current directory
(i.e. starts with one or two dots, followed by a directory separator), it
remains unchanged.
read_mini
Void open_log_file (String_Type file)
The open_log_file
function causes S-lang traceback messages
to be written to the specified file. This is useful for debugging
macros. Traceback messages are enabled by setting the S-lang
variable _traceback
to a non-zero value.
close_log_file, log_message, _traceback, _trace_function
Void print_file (String_Type file)
The print_file
function may be used to send a specified file
to the printer.
The printer is specified via the slrnrc printer_name
variable.