Link to home
Start Free TrialLog in
Avatar of light_bulb
light_bulbFlag for United States of America

asked on

Determine if a file is open

How can I easily determine if a file is already open before I try to open it programatically.

Specifically, my program involves displaying pdf files in Acrobat Reader.  If the user already has one the pdf file open, how can detect that?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kretzschmar
usual a try to open the file exclusive should tell you if you can do this,
if you can -> the file is not in use
if you not can -> the file is use

guess this does the suggestion of  Johnjces already,
it could be done with a TFileStream aslo

meikl ;-)