Knowing when file is no longer in use

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Is there a way I can find out if a file is in use or not? My app is calling
an external converter and doesn't wait for it to finish (would like it to,
but doesn't appear that it can). The problem is, it never knows when the
file the external converter writes to is finished. I've tried a few things,
including waiting for the file attributes to become FileAttributes.Normal
(which it never becomes). The file attribute is always
FileAttributes.Archive... even while it's being written.

Anyone know how I can know when the file has finished being written?
 
Greg said:
Is there a way I can find out if a file is in use or not? My app is
calling an external converter and doesn't wait for it to finish
(would like it to, but doesn't appear that it can). The problem is,
it never knows when the file the external converter writes to is
finished. I've tried a few things, including waiting for the file
attributes to become FileAttributes.Normal (which it never becomes).
The file attribute is always FileAttributes.Archive... even while
it's being written.

Anyone know how I can know when the file has finished being
written?

I think you can only check from time to time if you can open it in the
needed file and sharing mode.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Armin Zingler said:
I think you can only check from time to time if you can open it in the
needed file and sharing mode.

I actually ended up just going by the last write time. It seems to be
working well for my purpose.
 
Back
Top