The %fopen() function opens the host OS file designated by str and associates a stream with it.
stream = (char*)%fopen(str, type)
str | Specifies the file to open. | |
type | Character string having one of these values: | |
r | Opens for reading only. | |
r+ | Opens for update. | |
w | Truncates or creates for writing only. | |
w+ | Truncates or creates for update. | |
a | Append. Opens for writing at the end of file or creates for writing. | |
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.
stream=(char*)%fopen(’fname’,"w+") if stream=0 then crt ’Cannot open stream. errno=’:system(0) end