|Command||basic.%fopen C Function/BASIC Program
Applicable release versions: AP/Unix
|Category||BASIC Program (486)|
|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.
stream=(char*)%fopen('/usr/pick/fname',"w+") if stream=0 then crt 'Cannot open stream. errno=':system(0) end