Guardian Procedure Calls Reference Manual

File has not been opened, wrong file type; indicates that the file is not an EDIT file (that is, the file type is not
unstructured or the file code is not 101 or 102).
16
Unable to obtain buffer space; indicates that the file's directory does not fit into IOEdit's extended data
segment and OPENEDIT_ is unable to enlarge the segment.
31
Unable to obtain memory space for control block; indicates that the number of IOEdit files already open is
equal to the maximum number specified or assumed when INITIALIZEEDIT was called.
34
File is bad; indicates that the file exists and has the correct file type and file code for an EDIT file, but the
data in the file has an incorrect format and OPENEDIT_ is unable to repair it.
59
The negative values listed above indicate that OPENEDIT has found a format error in the file that
it can probably correct. At the time that one of these values is returned, the file has not yet been
altered. If you immediately call CLOSEEDIT or CLOSEEDIT_, the file is closed without change. If
instead you call another IOEdit procedure, IOEdit tries to correct the format of the file. The format
corrections are written to disk when CLOSEEDIT or CLOSEEDIT_ is finally called. If IOEdit fails to
correct the format error, error 59 is returned for all subsequent IOEdit operations on the file.
Considerations
The caller must set the filenum parameter to an appropriate value before each call to
OPENEDIT, because its value might be changed upon return.
If the file is already open at the time of the call to OPENEDIT, the flags, sync-depth, and
write-thru parameters to OPENEDIT are ignored.
OPENEDIT sets the file's current record number to -1 and resets the line number increment to
1 (that is, it resets the record number increment to 1000).
If OPENEDIT calls the CREATE procedure, it sets the primary and secondary extent sizes to
two pages each and sets the maximum number of extents to 900.
If OPENEDIT opens a file that is already open by the same process, it writes to disk all the
buffers for that file, including directory information. This assures that the file is in an up-to-date
state at the completion of the open. For a general discussion of coordinating concurrent file
access, see the Guardian Programmer's Guide.
See also the OPEN procedure Considerations (page 901).
Example
In the following example, OPENEDIT calls OPEN for the file $MYVOL.TEST.AFILE. The default flag
values are used (read-only, shared access, and nowait mode):
INT .EXT fname[0:11] := [ $MYVOL TEST AFILE ];
INT .EXT fnumber := -1;
.
.
err := OPENEDIT ( fname, fnumber );
Related Programming Manual
For programming information about the IOEdit procedures, see the Guardian Programmer's Guide.
916 Guardian Procedure Calls (O)