basic.%fopen
Opens a stream.
Syntax
stream=(char*)%fopen(string, type)
Description
opens the Unix file designated by 'string' and associates a stream with it.
'type' is a character string having one of the following values:
'r' Opens for reading only.
'w' Truncates or creates for writing only.
'a' Append; opens for writing at the end of file or creates for writing.
'r+' Opens for update.
'w+' Truncates or creates for update.
'a+' Append; opens for writing at the end of file or creates for update.
The stream is returned as a pointer to a character or 0 if an error occurred. System(0) contains the error number.
Streams are not automatically closed at program termination.
Example
stream=(char*)%fopen('/usr/pick/fname','w+')
if stream=0 then
crt 'Cannot open stream. errno=':system(0)
end
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
