Name
open_fileopen_fileOpenFileopen_fileOpenFileOpenFile — Open a file in ASCII or a binary format.
open_fileopen_fileOpenFileopen_fileOpenFileOpenFile opens a file in ASCII format or in binary
format. The name
of the file is defined by the parameter FileNameFileNameFileNameFileNameFileNamefileName.
The operator returns the FileHandleFileHandleFileHandleFileHandleFileHandlefileHandle. The parameter
FileTypeFileTypeFileTypeFileTypeFileTypefileType determines the type of the file.
The following settings for FileTypeFileTypeFileTypeFileTypeFileTypefileType are supported:
FileTypeFileTypeFileTypeFileTypeFileTypefileType Result
-------------------------------------------------------------------------------------
'input'"input""input""input""input""input" An already existing input file is opened for reading in
ASCII format.
'output'"output""output""output""output""output" A new output file is opened for writing in ASCII format.
'append'"append""append""append""append""append" An already existing output file is opened at the end of
the file for writing in ASCII format.
'input_binary'"input_binary""input_binary""input_binary""input_binary""input_binary" An already existing input file is open for reading in
binary format.
'output_binary'"output_binary""output_binary""output_binary""output_binary""output_binary" A new output file is opened for writing in binary format.
'append_binary'"append_binary""append_binary""append_binary""append_binary""append_binary" An already existing output file is opened at the end of
the file for writing in binary format.
For terminal input and output the file names 'standard'"standard""standard""standard""standard""standard"
('input'"input""input""input""input""input" and 'output'"output""output""output""output""output") and 'error'"error""error""error""error""error"
(only 'output'"output""output""output""output""output") are reserved.
- Multithreading type: exclusive (runs in parallel only with independent operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Name of file to be opened.
Default value:
'standard'
"standard"
"standard"
"standard"
"standard"
"standard"
Suggested values: 'standard'"standard""standard""standard""standard""standard", 'error'"error""error""error""error""error", '/tmp/dat.dat'"/tmp/dat.dat""/tmp/dat.dat""/tmp/dat.dat""/tmp/dat.dat""/tmp/dat.dat"
Type of file.
Default value:
'output'
"output"
"output"
"output"
"output"
"output"
List of values: 'append'"append""append""append""append""append", 'append_binary'"append_binary""append_binary""append_binary""append_binary""append_binary", 'input'"input""input""input""input""input", 'input_binary'"input_binary""input_binary""input_binary""input_binary""input_binary", 'output'"output""output""output""output""output", 'output_binary'"output_binary""output_binary""output_binary""output_binary""output_binary"
* Creating an output file with the name '/tmp/log.txt' and writing
* of a string:
open_file('/tmp/log.txt','output',FileHandle)
fwrite_string(FileHandle,'these are the first and last lines')
fnew_line(FileHandle)
close_file(FileHandle)
/* Creating an output file with the name '/tmp/log.txt' and writing */
/* of a string: */
open_file("/tmp/log.txt","output",&FileHandle) ;
fwrite_string(FileHandle,"these are the first and last lines") ;
fnew_line(FileHandle) ;
close_file(FileHandle);
* Creating an output file with the name '/tmp/log.txt' and writing
* of a string:
open_file('/tmp/log.txt','output',FileHandle)
fwrite_string(FileHandle,'these are the first and last lines')
fnew_line(FileHandle)
close_file(FileHandle)
* Creating an output file with the name '/tmp/log.txt' and writing
* of a string:
open_file('/tmp/log.txt','output',FileHandle)
fwrite_string(FileHandle,'these are the first and last lines')
fnew_line(FileHandle)
close_file(FileHandle)
* Creating an output file with the name '/tmp/log.txt' and writing
* of a string:
open_file('/tmp/log.txt','output',FileHandle)
fwrite_string(FileHandle,'these are the first and last lines')
fnew_line(FileHandle)
close_file(FileHandle)
* Creating an output file with the name '/tmp/log.txt' and writing
* of a string:
open_file('/tmp/log.txt','output',FileHandle)
fwrite_string(FileHandle,'these are the first and last lines')
fnew_line(FileHandle)
close_file(FileHandle)
If the parameters are valid, the operator
open_fileopen_fileOpenFileopen_fileOpenFileOpenFile returns the value 2 (H_MSG_TRUE).
If necessary, an exception is raised.
fwrite_stringfwrite_stringFwriteStringfwrite_stringFwriteStringFwriteString,
fread_charfread_charFreadCharfread_charFreadCharFreadChar,
fread_stringfread_stringFreadStringfread_stringFreadStringFreadString,
fread_linefread_lineFreadLinefread_lineFreadLineFreadLine,
fread_serialized_itemfread_serialized_itemFreadSerializedItemfread_serialized_itemFreadSerializedItemFreadSerializedItem,
fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItem,
close_fileclose_fileCloseFileclose_fileCloseFileCloseFile
close_fileclose_fileCloseFileclose_fileCloseFileCloseFile,
fwrite_stringfwrite_stringFwriteStringfwrite_stringFwriteStringFwriteString,
fread_charfread_charFreadCharfread_charFreadCharFreadChar,
fread_stringfread_stringFreadStringfread_stringFreadStringFreadString,
fread_linefread_lineFreadLinefread_lineFreadLineFreadLine
Foundation