Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 26
Purging Data When Opening
²
If a block buffer is used in a TNS caller, it must be located in G[0:32767] of the
data area. This limitation does not apply to native callers. See Section 16,
Creating and Managing Processes, for details.
The following example specifies a block buffer named OUTBLKBUF that is 4096 bytes
long:
LITERAL OUTBUFLEN = 4096;
INT .OUTBLKBUF[0:OUTBUFLEN -1];
.
.
CALL OPEN^FILE(COMMON^FCB,
OUTFILE,
OUTBLKBUF,
OUTBUFLEN);
Purging Data When Opening
You can delete all data from an SIO file when you open it by setting the PURGE^DATA
flag in the OPEN^FILE call. The file FCB must be set up for write-only access.
The following example purges the data from the file with FCB DFILE:
CALL SET^FILE(DFILE,
ASSIGN^OPENACCESS,
WRITE^ACCESS);
.
.
FLAGS := PURGE^DATA;
FLAGS^MASK := PURGE^DATA;
CALL OPEN^FILE(COMMON^FCB,
DFILE,
!block^buffer!,
!block^bufferlen!,
FLAGS,
FLAGS^MASK);
Getting Information About SIO Files
Use the CHECK^FILE procedure to obtain information about a given SIO file. The
CHECK^FILE procedure gets its information from the FCB of the file and can include:
File attributes set when the file was opened or explicitly set by the SET^FILE
procedure
General status information about the file that is dynamically updated by the SIO
procedures that use the file
An example of retrieving attribute information might be to get the name of the file. The
FILE^FILENAME^ADDR operation returns the address of the name. Note that for
CHECK^FILE calls that return an address value, the TAL and pTAL forms of the call
differ.