Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flock()= exclusive use
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00291872
Message ID:
00291905
Vues:
26
>>If I want to get exclusive use of a dbf() on the network Can I simply test for someone using it first by issuing " ?flock()" so that I won't have to resort to an error routine?
>
>You can still get a file lock on a table that is open by another user as long as the other user has no records locked. While it is a good first clue to exclusivity, flock is not a guarantee that you can then open the table exclusively. Try:

>lcOldError = on('error')
>llOpen = .t.
>on error llOpen = .f.
>use mytable excl
>on error &lcOldError
>if !llOpen
> return .f.

Mark, does the used() command work,I just want to know if the file is being used at all by another user without an error routine. otherwise I will follow your example.
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform