Requesting Nowaited Writes - HP TACL Programming Manual

Tandem advanced command language
Table of Contents

Advertisement

Accessing Files

Requesting Nowaited Writes

Requesting Nowaited
Writes
Note
4–8
To open a file for nowaited write operations, issue a #REQUESTER call and omit the
WAIT option. The following statement opens FILE1 and initializes error_var and
write_var. If FILE1 does not exist, TACL creates an Edit file:
#SET rslt [#REQUESTER WRITE file1 error_var write_var]
It is very important to check the results of the open operation. Otherwise, you will not know if the open
request received an error.
To specify shared, protected, or exclusive access to the file, use the EXCLUSION
option; the default for a write operation is shared. For example:
#REQUESTER /EXCLUSION PROTECTED/ WRITE file2 error_var &
write_var
To initiate the write operation, append data to the write variable:
#APPEND write_var This is a test
When TACL detects data in write_var, it writes the record to FILE1.
You can add a record to a structured file but you cannot replace a record. If you
attempt to write a record that already exists, TACL returns an error.
Each time you append a line to write_var, the TACL process writes a record to
FILE1. TACL continues executing code. When you are ready to wait for completion of
the read operation, use the #WAIT built-in function to wait until the write_var
contains data. To avoid writing over data that has not yet been transmitted, use
#WAIT to make sure the previous operation has finished.
When you are finished writing to the file, call the #WAIT function to make sure that
the last write has finished. Next, issue a CLOSE request and supply one of the variable
levels associated with the file; for example:
#REQUESTER CLOSE write_var
This operation closes FILE1 (associated with write_var) and terminates the
#REQUESTER function.
107365 Tandem Computers Incorporated

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents