Depends.
If you have control of the program which is doing the writing, consider locking the file with flock() exclusively before writing to it, then unlocking when finished
Have the other program put a nonexclusive lock on the file - it should then be blocked until the file is fully written.
Of course semantics are rather different on Windows I think.
On Unix, unlike DOS, files are NOT shown as 0 bytes while they're open for writing. They are shown at the size they happen to be at approximately that moment.
One option is to wait until the file stops growing - this is primitive. On win32 the other process will probably put an exclusive lock on the file (unless it's told not to).
Mark