>I am running a VFP 6.0 app on a network which is using the same tables I am using. The other app uses the files exclusively. I need to be able to check if the files (cust.dbf) is in use by another computer so my code doesn't bomb out when it goes to to a USE command. I tried ISFLOCKED() but it needs an alias and I can't create the alias without issuing the USE command. HELP!
I use low-level file functions to do the check, these return an error code :
fh = fopen( "cust.dbf" )
if ( fh <> -1 )
fclose( fh )
use cust.dbf
else
wait window "File In Use"
endif
there is the danger that another will grab the file in the small time window between the fclose & the use & there's no guarantee that the -1 return is due to the file already being open - it may not exist for example, but extra code code be put in to test these conditions if required.
If anyone knows a better method, I'd like to know
hth
Paul
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only