Doing multiple open and close statements is the correct way to go here. It clearly documents that the file might be changing in the interim 10 seconds wait.
You might considering doing a shared read lock using flock, but I doubt that it's a strong need for you nor that the other process would respect it.
In reply to Re: reading a changing file
by wind
in thread reading a changing file
by slogger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |