filelock statement
.mdThe filelock statement sets an exclusive lock on an entire file.
Syntax
filelock {file.var} {locked statement.block}
Parameter(s)
| 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. |
Description
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.
See also
Referenced by
1 topic mentions filelock statement in its description.