Waiting for an exclusive access to hashed file
Posted: Mon Jan 19, 2009 12:38 pm
Hello all,
I am using the FILELOCK statement to ask for an exclusive access to a hashed file and it is working very well....
But, in case the file is locked by another user I would like my routine to wait some seconds for the resource and then to ask again , in a loop, until the file is available.
Have you implemented something like that before? Do you have any suggestions?
I checked the "ON ERROR" and "LOCKED" statements to see if I could use them, but did not find anything related.
I am using the FILELOCK statement to ask for an exclusive access to a hashed file and it is working very well.
Code: Select all
TargetName = "TargetFile"
Open TargetName TO HashedTargetFile Then
FILELOCK HashedTargetFile
But, in case the file is locked by another user I would like my routine to wait some seconds for the resource and then to ask again , in a loop, until the file is available.
Have you implemented something like that before? Do you have any suggestions?
I checked the "ON ERROR" and "LOCKED" statements to see if I could use them, but did not find anything related.