Next Previous Contents

6. File I/O Functions

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.

6.1 close_log_file

Usage

Void close_log_file ()

Description

The close_log_file function closes the file previously opened by open_log_file.

See Also

open_log_file, log_message

6.2 log_message

Usage

Void log_message (String_Type msg)

Description

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.

See Also

open_log_file, close_log_file, message

6.3 make_home_filename

Usage

String_Type make_home_filename (String_Type name)

Description

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.

See Also

read_mini

6.4 open_log_file

Usage

Void open_log_file (String_Type file)

Description

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.

See Also

close_log_file, log_message, _traceback, _trace_function

6.5 print_file

Usage

Void print_file (String_Type file)

Description

The print_file function may be used to send a specified file to the printer.

Notes

The printer is specified via the slrnrc printer_name variable.


Next Previous Contents