FOPEN_ program instruction FOPENA Opens a file for read-write-append access. If the specified file does not already exist, the file is created. If the file already exists, no error occurs, and the file position is set to the end of the file. Write operations then append to the existing file. FOPEND Opens a disk directory for reading. The file name and extension in the file_spec parameter are used to prepare a file name template for use when read operations are later performed. Those read operations return only records from the disk directory file that match the file name template. Any attempt to write to the directory file causes an error.
(For information on the format of directory records, see the section Accessing the Disk Directories in the eV+ Language User's Guide .) The file name and extension can include wildcard characters (asterisks, *). A wildcard character within a file name or extension indicates that any character should be accepted in that position. A wildcard character at the end of a file name or extension indicates that any trailing characters are acceptable. A wildcard character in place of a file name (or extension) indicates that any name (or extension) is acceptable. Omission of the file name, the period, and the file extension is equivalent to specifying *.*.
Omission of the period and file extension is equivalent to specifying a wildcard extension. FOPENR Opens a file for read-only access. If the file does not already exist, an error occurs. Any attempt to write to the file causes an error. FOPENW Opens a file for read-write access. If the file already exists, an error occurs. Any error in the specification of this instruction (such as attempting to access an invalid unit) will cause a program error and will halt program execution. However, errors associated with performing the actual operations (such as device not ready) do not halt program execution since these errors can occur in the normal operation of a program.
These normal errors can be detected by using the IOSTAT function. Example FOPENR (5) "data.dat" eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 249