Link to home
Create AccountLog 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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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 ;-)