SA_FilePI


 

SA_FilePI enqueues one or more file control blocks providing exclusive access to the calling program.

int SA_FilePI ( SA_FH TxtFH[]);

Parameters:
TxtFH
A null terminated array of file handles to be locked.

Note the following:

  1. This function will lock the files specified causing other programs using the Sunaccess modules or Sunbelt PL/B programs to wait until the locks are released before performing any file operations on the specified files.

  2. It is only necessary to perform a SA_FilePI when a record is read and re-written (updated). If the SA_FilePI is performed prior to the read and released after the update, it is not possible for other processes to have accessed the files during that period.

  3. Performing a SA_FilePIEnd terminates the enqueue.

  4. Function return codes are as follows:

  5.  

    Value

    Meaning

    1

    Success.

    0

    No SA_FilePI in effect.

    -nn

    Error as described in Sunaccess Errors

     

     



Sunaccess Reference SA_Erase SA_FilePIEnd