The filelock statement sets an exclusive lock on an entire file.
filelock {file.var} {locked statement.block}
file.var | File to lock. If file.var is not specified, then the default file variable is assumed. |
locked statement.block | If the file is already locked (meaning another user has a file or an item lock, or is currently updating that file) and the optional locked clause is present, then statement.block is executed. If no locked clause is present, then the statement blocks until the situation is resolved. Note: system(0) in the locked clause returns the port number that has the item
locked.
|
The filelock statement is useful for preventing updates to a file while a sequential operation is running (like a BASIC select).
Once a file lock has been set, any attempt by another port to update, item lock, or file lock that file fails.
File locks are displayed by the TCL list-locks command as special item locks with item-IDs of * and hash values of 0. If necessary, these locks can be cleared atypically with the TCL unlock-file command.
begin work statement, clear-basic-locks macro, clear-locks command, fileunlock statement, list-locks command, statement blocks, Statements and functions, then clause, then/else statement blocks, u0191 user exit, u1191 user exit, u2191 user exit, u3191 user exit, unlock statement, unlock-file command, unlock-item command