Reply 20 of 37, by wd
In DOS, the second handle sees the file size as what it was before the first handle wrote to the file (from the directory entry, I guess). In DOSBox, the second handle sees the revised size of the file in blocks of 4kB, i.e. any residual portion less than 4kB is not yet written to disk. It smells like a write buffer is employed by fwrite() or the host OS, so the behavior could vary between C runtime libraries and platforms.
This all uses one file handle opened for writing, and another for reading from the same file, right?