L
Lonifasiko
Hi,
Using Process class I asynchronously launch an executable (black box
executable) file from my Windows application. I mean asynchronously
because I've got an EventHandler for "Exited" event. Therefore, when
process finishes, "Exited" event is raised.
This executable writes a long file for over 1-5 minutes, and I, from
my application must read that file while is being generated.
Therefore, after launching the executable calling "Start()" method, I
initialize a timer which tries to read from the file every 20 seconds
for example.
The result is that when trying to read for the first time, process
exits and I need the process to continue executing. I thought it was
because of reading the file simultaneously (file sharing violation),
but if I try just to show a message, occurs the same. Process exits
always.
Then, which would be the best way to read a file that is being
written? Maybe threads? A FileSystemWatcher? Is it possible?
Thanks very much in advance.
Using Process class I asynchronously launch an executable (black box
executable) file from my Windows application. I mean asynchronously
because I've got an EventHandler for "Exited" event. Therefore, when
process finishes, "Exited" event is raised.
This executable writes a long file for over 1-5 minutes, and I, from
my application must read that file while is being generated.
Therefore, after launching the executable calling "Start()" method, I
initialize a timer which tries to read from the file every 20 seconds
for example.
The result is that when trying to read for the first time, process
exits and I need the process to continue executing. I thought it was
because of reading the file simultaneously (file sharing violation),
but if I try just to show a message, occurs the same. Process exits
always.
Then, which would be the best way to read a file that is being
written? Maybe threads? A FileSystemWatcher? Is it possible?
Thanks very much in advance.