Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (O)
Guardian Procedure Calls Reference Manual—522629-013
11-36
OPEN^FILE Procedure
the value of EOF is greater) when compared to the same file managed by SIO 
prior to D20. The file is not actually larger, as the same amount of disk space is 
allocated in both cases.  The difference is that in the newer version, the last part of 
each new extent is immediately put into use. 
•
SIO always performs buffered I/O, using the disk process buffering mechanism to 
enhance performance, when writing to an EDIT file. You can force SIO to flush 
buffered data to disk by calling WRITE^FILE and specifying a 
write-count of -1.  
•
For performance reasons, it is recommended that you provide a block buffer with a 
length of about 2100 bytes. This is because SIO normally requires slightly more 
than 2048 bytes to assemble EDIT file pages. 
•
You must specify either read or write access when opening an EDIT file; read/write 
access is not permitted.
Level-3 Spooling Considerations
•
Level-3 spooling allows multiple records to be sent per message to a spooler 
collector, greatly reducing the number of messages required to do spooling. To 
use level-3 spooling with SIO, you must open a spooler collector by calling 
OPEN^FILE. The following requirements must be met:
•
You must set the LEVEL3^SPOOL^ENABLE flag ON in the call to OPEN^FILE. 
•
You must provide a block buffer with a length of at least 1024 bytes. 
•
The open exclusion mode of the file must be shared. 
•
The maximum record length of the print line buffer is 900 bytes. 
If any of these requirements are not met, level-3 spooling is not enabled. You can 
verify whether level-3 spooling is enabled by calling the CHECK^FILE procedure 
and specifying the FILE^LEVEL3^SPOOLING operation. 
•
CONTROL or SETMODE operations are not allowed on a file that is opened by 
SIO for level-3 spooling; error 2 is returned by CONTROL or SETMODE for any 
operation. Certain CONTROL operations can be requested in a call to 
OPEN^FILE or WRITE^FILE; these continue to be available when a file is opened 
for level-3 spooling. 
•
The spooler interface procedures, through which SIO performs spooling, do not 
support nowait I/O. You can set the NOWAIT flag ON in a call to OPEN^FILE and 
WRITE^FILE, but SIO still performs I/O operations to a spooler collector in a 
waited manner. 
Example
ERROR := OPEN^FILE ( COMMON^FCB , IN^FILE , BUFFER
 , BUFFER^SIZE , FLAGS , FLAGS^MASK , , PROMPT );










