in reply to How to check a files Status?
How do you define "open" and "closed"? You may want to have the software package write a well defined trailer at the end of the file right before it completes. That way, there is no ambiguity of whether the software is done.
If you have no control over the software package itself or the format of the file, one idea is to get some statistic about the file (last line or byte size), sleep, get the same statistic again and compare it to the last one. Loop that until the statistic didn't change. The problem with this is it is not certain to work unless you can guarantee that the software package writes more often than your script wakes up.
Edit: I like ikegami's solution better.
|
|---|