>Thanks for the info, but...
>
>When I try FOPEN() it returns -1 regardless of the lock state of the table. How would I determine locked vs unlocked with this function?
>
>Sorry to be so ignorant on this.
Richard,
You get .t. from IsFlocked() only if you and current session locked the table.
fopen() returning -1 means that you couldn't open it. Possible cause is already locked somewhere else, session or user. You should also check ferror() if the cause wasn't something else like 'file doesn't exist'
function NotLockedByElse
lparameters tcFile
handle=fopen(tcFile)
if handle>0
fclose(handle)
return .f.
else
return ferror()=5
endif
Also you could use
if flock() && Attempt lock if not locked
Cetin