Open text file.
The operator open_file opens a file. FileType determines whether this file is an input ('input') or output file ('output'). Text files which can be accessed either by reading ('input') or by writing ('output') are created. The newly opened file becomes the active file, i.e. all input and/or output is handled by this file until the file is closed (close_file) or another file is activated (set_file).
FileName (input_control) |
string -> string |
Name of file to be opened. | |
Default value: '/tmp/horus.txt' |
FileType (input_control) |
string -> string |
Type of file. | |
Default value: 'output' | |
List of values: 'input', 'output' |
/* Creating of an outputfile with the name '/tmp/log.txt' and writing */ /* of one string: */ open_file(::'/tmp/log.txt','output':) > fwrite_string(::'these are the first and last lines':) > fnew_line(:::) > close_file(::output:).
If the parameters are correct the operator open_file returns the value TRUE. Otherwise an exception is raised.
set_file, fwrite_string, fread_char, fread_string, close_file
close_file, fwrite_string, fread_char, fread_string, set_file