Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding, if file is used exclusively
Message
De
05/10/2000 12:31:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00425134
Message ID:
00425381
Vues:
21
>>This can fail. Another user can grab the table between the RETURN and USE EXCLUSIVE. I'm not saying it will, but the possibility is there.
>
>You could reduce the probability of this by an incredibly small amount by doing the close and return at the same time:
RETURN fh > 0 AND FCLOSE(fh)
This way the close does not happen until the very last moment. And because VFP evaluates expressions from left to right and there is an AND, if the file was not opened then the FCLOSE() will not be attempted.

That does reduce the time between them, but still leaves open the possibility that someone else will grab the file.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform