Ive seen this discussed before and the usual answer is for your application
simply catch (and handle) any exceptions caused by file access -since there
might be other reasons why a file does not open (e.g. permissions). Simply
doing any pre-checks on the file is still no guarantee that a file is going
to open at the exact moment of the request -so you would still need to catch
and handle potential exceptions anyway.
--
Best Regards,
Mark
Mark Broadbent
mcad,mcdba,mcse+i
emailto: newsgroupsATmettayyaDOTgotadslDOTcoDOTuk
remove AT with '@' and DOT with '.' -please do not send spam or address will
be changed!
"Holger" <Ho****@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
Hello everyone,
is there a way to check if a file is in use by another program. One
possibility would be to poll the file for an exclusive lock, but this has
very bad consequences for the performance of my program.
Thanks, Holger