Guardian Procedure Calls Reference Manual
• Locks and open files—applies to non-audited files only
Locks are granted on an open file (that is, file number) basis. Therefore, if a process has
multiple opens of the same file, a lock of one file number excludes access to the file through
other file numbers.
• Attempting to read a locked file in default locking mode
If the default locking mode is in effect when a call to FILE_READ64_ or FILE_READUPDATE64_
is made to a file which is locked by another user, the caller of FILE_READ64_ or
FILE_READUPDATE64_ is suspended and queued in the "locking" queue behind other users
attempting to access the file.
NOTE: For non-audited files, a deadlock condition—a permanent suspension of your
application—occurs if FILE_READ64_ or FILE_READUPDATE64_ is called by the process which
has a record locked by a filenum other than that supplied in FILE_READ64_ or
FILE_READUPDATE64_. (For an explanation of multiple opens by the same process, see the
FILE_OPEN_ Procedure (page 457).)
• Accessing a locked file
If the file is locked by a user other than the caller at the time of the call, the call is rejected
with file-system error 73 ("file is locked") when:
◦ FILE_READ64_ or FILE_READUPDATE64_ is called, and the alternate locking mode is in
effect.
◦ FILE_WRITE64_, FILE_WRITEUPDATE64_, or FILE_CONTROL64_ is called.
• A count of the locks in effect is not maintained. Multiple locks can be unlocked with one call
to FILE_UNLOCKFILE64_. For example:
.
ERROR := FILE_LOCKFILE64_ ( FILE^A,...); ! FILE^A becomes locked.
.
ERROR := FILE_LOCKFILE64_ ( FILE^A,...); ! is a null operation,
! because the file is
! already locked.
.
ERROR := FILE_UNLOCKFILE64_ ( FILE^A,...); ! FILE^A becomes unlocked.
.
ERROR := FILE_UNLOCKFILE64_ ( FILE^A,...); ! is a null operation,
! because the file is
! already unlocked.
OSS Considerations
This procedure operates only on Guardian objects. If an OSS file is specified, error 2 occurs.
Related Programming Manual
For programming information about the FILE_UNLOCKFILE64_ procedure, see the Enscribe
Programmer's Guide and the Guardian Programmer's Guide.
452 Guardian Procedure Calls (F)