basic.filelock

Statement/BASIC Program, Releases: AP 6.2

Sets an exclusive file lock.

Syntax

filelock {file.variable} { locked statement.block}

Description

sets an exclusive lock on an entire file.

Once a file lock has been set, any other port which attempts to update, item lock, or file lock that file will fail.

If file.variable is not specified, then the default file variable is assumed.

The filelock is useful preventing updates to a file while a sequential operation is running (like a BASIC select).

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.

File locks are displayed by the 'list-locks' TCL command as special item locks with item id's of '*' and hash's of 0. If necessary, these locks can be cleared abnormally with the 'unlock-file' command.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.fileunlock Statement Releases an exclusive file lock.
tcl.list-locks Verb: Access Displays status of all locks.
basic.begin.work Statement Starts a transaction

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.