Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to check in-use of EXE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01276237
Message ID:
01276246
Vues:
23
Colin,

I use a kind of similar scheme. In a certain table each user creates a record and it is locked with rlock(). However, the session might crash. In that case the record will be unlocked, which is useful info by the way. But there's another situation that needs to be tackled. It is the situation that some other process uses the exe (indeed a vfp-exe in my case) or that the exe is used with a dataset that I have not under control, e.g. a local dataset. In that case I try to FOPEN() the exe as readwrite. This takes one second on my development machine, but it appears to take far more time on another network. I'm wondering whether there is a faster way to check its usage.

I have also tried the API call OpenFile(). This one too is one second on my machine, indicating it is the lowlevel equivalent of FOPEN().

>Peter
>
>I usually try to open one of the apps shared tables as exclusive - if I get an error the app is in use
>
>I take this a stage further - all users have temp files on their cdrives which they open as exclusive - I poll round the pcs in the network attempting to open one of their temp files as exclusive - error = user in app
>
>Then a form diplays the results with a colour box next to each user name - green = not using app, red = using app, blue = pc not on line
>
>Our ops pepole use this screen at night to make sure all are out of apps so that overnight runs can work
>
>HTH
>
>Colin
>
>>Hi all,
>>
>>What is the fastest way to check whether an EXE is in use?
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform