HI
Read my FAQ on this
How to ensure that only one instance of my application is running in my desktop.
faq184-839
ramani
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
"I need to check whether a program is running before i can overwrite the file"
is not very explicit.
If you are referring to a VFP application, then ramani's FAQ will give you a solution - if not, please give sufficient information in your question for someone to be able to present you with an appropriate answer. HTH
You could simply try something like this:
[tt]
cSaveError=ON("ERROR"
lError=.F.
ON ERROR lError=.T.
COPY FILE myExe.exe TO \LIVE\myExe.EXE
ON ERROR &cSaveError
IF lError
&& File copy failed...probably was in use
ELSE
&& File copy succeeded, couldn't have been in use
ENDIF
[/tt]
Ian
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.