File lockingΒΆ

A file may be locked by means of a read lock or a write lock.

A read lock prevents the file from being locked or updated by any process, including the process which placed the lock. This enables the records in a file to be examined with the certain knowledge that none of them is currently being amended by other users.

A write lock prevents the file from being locked or updated by any other process, except for the process which placed the write lock. This enables the update of more than one record in a file, without other users being able to see the results of any of the updates until all have been completed. First the write lock is obtained, then the updates are made. While updates are in progress other users have no access to the file. Finally, the write lock is removed, freeing all the updated records to other users simultaneously.

The readlock and writelock commands are used to perform these functions.

Both types of lock are removed by means of the unlock command.


RELATED TOPICS

Keyed files

Record locking