FILEPI
ANSI
The FILEPI instruction locks the specified files from usage by other PL/B programs for the specified number of instructions. It uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
count
Required. A decimal constant or Expression that designates the number of instructions the file(s) is locked.
list
Required. A list of logical FILE, IFILE, and/or AFILE definitions or a FILELIST that is locked.
Flags Affected: NONE
Note the following:
FILEPI automatically terminates upon the occurrence of a GUI object method or any of the following verbs:
|
ACTIVATE |
DISPLAY |
KEYIN |
PRTOPEN |
SHUTDOWN |
|
ALERT |
DSCNCT |
OPEN |
PRTPAGE |
SNDOPEN |
|
BEEP |
EVENTCHECK |
PAGESETUP |
PREP |
SPLOPEN |
|
CHAIN |
EVENTWAIT |
PAUSE |
RELEASE |
PERFORM |
|
COMCHECK |
EXECUTE |
|
RELEASEJOB |
SPLCLOSE |
|
DBCONNECT |
GETFNAME |
PRTCLOSE |
ROLLOUT |
STOP |
A FILEPI automatically terminates upon the program stopping, returning control to a modal DIALOG or if an untrapped error occurs.
The FILEPI instruction counter is not decremented by the following verbs:
|
BRANCH |
ELSE |
LOOP |
RETURN |
|
BREAK |
ELSEIF |
LROUTINE |
ROUTINE |
|
CALL |
ENDIF |
NORETURN |
STOP |
|
CALLS |
GOTO |
PERFORM |
UNTIL |
|
CONTINUE |
IF |
REPEAT |
WHILE |
To terminate a FILEPI prior to its scheduled release, PI 0 or FILEPI 0 may be used.
{count} must be in the range of one (1) to ninety-nine (99).
{list} may be from one (1) to twenty (20) open file definitions that are locked.
FILEPI is not supported by the PLBCE runtime.
If an AAM or ISI file is specified in {list}, the actual file that is locked is the data file associated with the index. Therefore, multiple index files that point to the same data file should not be specified in {filelist}. Locking the data file once covers all index files with which it may be associated.
If {list} specifies a FILELIST, all files within the list are locked.
In a situation where a data file is being accessed both with and without Record Locking, a FILEPI instruction will only be able to lock and gain to access to the file when all record locks are released for the file. In addition, it is possible that a FILEPI can cause an infinite deadlock situation if a record lock is active and the FILEPI is executed in the same program.
A FILEPI 1 instruction is not required to cover any IFILE or AFILE IO instructions. Additionally, if a FILEPI 1 instruction is executed to cover a single READ of an AFILE or IFILE, this FILEPI usage minimizes the capability of a PLB Linux runtime from optimizing IO operations to give the best performance.
See Also: Example Code, SHARE Access Mode, Disk I/O Instructions
![]() |