Is a File being written

  • Thread starter Thread starter S Shulman
  • Start date Start date
S

S Shulman

Hi all

Is the a way of knowing whether a stream is open to a specific file
I need to create a file using another program and only when the program
finished writing the file I can copy it and I can't interact with the other
program to get this info on whether it is finished writing the file

Any dll .NET functions

Thank you in advance,
Shmuel Shulman
 
S Shulman said:
Is the a way of knowing whether a stream is open to a specific file
I need to create a file using another program and only when the program
finished writing the file I can copy it and I can't interact with the
other program to get this info on whether it is finished writing the file

You can try to access the file and catch the exception that is thrown if the
file is exclusively locked by the other operation. Then you can do this
check using a timer every n milliseconds until the other application
releases the file.
 
Thanks Herfried

Seems to work

Shmuel


Herfried K. Wagner said:
You can try to access the file and catch the exception that is thrown if
the file is exclusively locked by the other operation. Then you can do
this check using a timer every n milliseconds until the other application
releases the file.
 
Herfried,
You can try to access the file and catch the exception that is thrown if
the file is exclusively locked by the other operation. Then you can do
this check using a timer every n milliseconds until the other application
releases the file.

I do not find this a Herfried solution from the last months.

(It is to practical and to easy to implement)

:-)))

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top