Name
open_fileT_open_fileOpenFileOpenFile — Open a file in ASCII or a binary format.
open_fileopen_fileOpenFileOpenFileOpenFile opens a file in ASCII format or in binary
format. The name
of the file is defined by the parameter FileNameFileNameFileNameFileNamefileName.
The operator returns the FileHandleFileHandleFileHandleFileHandlefileHandle. The parameter
FileTypeFileTypeFileTypeFileTypefileType determines the type of the file.
The following settings for FileTypeFileTypeFileTypeFileTypefileType are supported:
- 'input'"input""input""input""input":
-
An already existing input file is opened for reading in ASCII format.
- 'output'"output""output""output""output":
-
A new output file is opened for writing in ASCII format.
- '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":
-
An already existing input file is opened for reading in binary format.
- '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":
-
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"
('input'"input""input""input""input" and 'output'"output""output""output""output") and 'error'"error""error""error""error"
(only 'output'"output""output""output""output") are reserved.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Name of file to be opened.
Default value:
'standard'
"standard"
"standard"
"standard"
"standard"
Suggested values: 'standard'"standard""standard""standard""standard", 'error'"error""error""error""error", '/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"
List of values: 'append'"append""append""append""append", 'append_binary'"append_binary""append_binary""append_binary""append_binary", 'input'"input""input""input""input", 'input_binary'"input_binary""input_binary""input_binary""input_binary", 'output'"output""output""output""output", '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)
If the parameters are valid, the operator
open_fileopen_fileOpenFileOpenFileOpenFile returns the value 2 (H_MSG_TRUE).
If necessary, an exception is raised.
fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteString,
fread_charfread_charFreadCharFreadCharFreadChar,
fread_stringfread_stringFreadStringFreadStringFreadString,
fread_linefread_lineFreadLineFreadLineFreadLine,
fread_serialized_itemfread_serialized_itemFreadSerializedItemFreadSerializedItemFreadSerializedItem,
fwrite_serialized_itemfwrite_serialized_itemFwriteSerializedItemFwriteSerializedItemFwriteSerializedItem,
close_fileclose_fileCloseFileCloseFileCloseFile
close_fileclose_fileCloseFileCloseFileCloseFile,
fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteString,
fread_charfread_charFreadCharFreadCharFreadChar,
fread_stringfread_stringFreadStringFreadStringFreadString,
fread_linefread_lineFreadLineFreadLineFreadLine
Foundation