While there might be a way to check for disk activity, that would not be
the best solution. For example, if the hard drive was working on the
Windows swap file after it wrote your file, then your program would be
waiting for quite a while.
Here is a solution I used: Before the first program (the one writing
the data file) starts writing, it creates a lockfile. The lockfile just
has to exist while the data file is being written. When the data file
is completed, delete the lockfile.
On the other program, it waits in a loop for the lockfile to become
available. It then goes into another loop to wait for the lockfile to
be deleted (then it can't be opened). Once the lockfile is deleted,
that program can safely read the data file.
I've used this method,
and it works well. The only reason I had to stop
using it was because there was a problem in the network communication,
and I was getting bad data files.
If you are using two different Labview programs, you can use some of the
synchronization VI's in version 5.0 and above.
Sent via Deja.com
http://www.deja.com/