Disk I/O preceded with a \, the path is absolute. Otherwise, the path is relative and is added to the current DEFAULT path specification. (If unit is specified and is different from the default unit, the path is always absolute.) filename is a name with 1 to 8 characters, which is used as the name of the file on the disk. ext is the filename extension-a string with 0 to 3 characters, which is used to identify the file type. The four open commands are: 1. Open for read only (FOPENR). If the disk file does not exist, an error is returned. No write operations are allowed, so data in the file cannot be modified. 2. Open for write (FOPENW). If the disk file already exists, an error is returned.
Otherwise, a new file is created. Both read and write operations are allowed. 3. Open for append (FOPENA). If the disk file does not exist, a new file is created. Otherwise, an existing file is opened. No error is returned in either case. A sequential write or a random write with a zero record number appends data to the end of the file. 4. Open for directory read (FOPEND). The last directory in the specified directory path is opened. Only read operations are allowed. Each record read returns an ASCII string containing directory information. Directories should be opened using variable-length sequential-access mode.
While a file is open for write or append access, another control program task cannot access that file. However, multiple control program tasks can access a file simultaneously in read- only mode. Writing to a Disk The instruction: WRITE (dlun) $in.string writes the string stored in $in.string to the disk file open on dlun. The instruction: error = IOSTAT(dlun) returns any errors generated during the write operation. Reading From a Disk The instruction: READ (dlun) $in.string eV+Language User's Guide, v2.x, 18318-000 Rev A Page 145