Difference between revisions of "FLOCK()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to lock file | Function to lock file | ||
− | |||
==Syntax== | ==Syntax== | ||
FLOCK([<workarea | alias>]) | FLOCK([<workarea | alias>]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[ACCESS()]], [[LOCK() | + | [[ACCESS()]], [[LOCK()]], [[RLOCK()]], [[SET EXCLUSIVE]], [[USE]] |
− | + | ||
==Description== | ==Description== | ||
The FLOCK() function attempts to logically lock the currently selected table. If successful, it returns .T. and the table is locked. If the table is already locked by another user, it returns .F. If the optional <workarea | alias> name is specified the function will operate in the required location. The FLOCK() function does NOT change the open status of the table to 'exclusive'. | The FLOCK() function attempts to logically lock the currently selected table. If successful, it returns .T. and the table is locked. If the table is already locked by another user, it returns .F. If the optional <workarea | alias> name is specified the function will operate in the required location. The FLOCK() function does NOT change the open status of the table to 'exclusive'. | ||
− | |||
− | |||
− | |||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
do while not flock() | do while not flock() | ||
− | |||
sleep 2 | sleep 2 | ||
enddo | enddo | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Manual Locking]] | [[Category:Manual Locking]] | ||
[[Category:Manual Locking Functions]] | [[Category:Manual Locking Functions]] |
Revision as of 07:33, 10 February 2012
Contents
Purpose
Function to lock file
Syntax
FLOCK([<workarea | alias>])
See Also
ACCESS(), LOCK(), RLOCK(), SET EXCLUSIVE, USE
Description
The FLOCK() function attempts to logically lock the currently selected table. If successful, it returns .T. and the table is locked. If the table is already locked by another user, it returns .F. If the optional <workarea | alias> name is specified the function will operate in the required location. The FLOCK() function does NOT change the open status of the table to 'exclusive'.
Example
do while not flock() sleep 2 enddo