I have a Windows Server 2008 R2 cluster, running a 3rd party trained algorithm that generates geometry and texture maps at high speeds. This is part of a WebAPI, with clients generating new geometry and texture maps on demand. About 1% of the time, when retrieving the largest texture map (a bit over a 1M in size), logic that knows the file size of this file compares the just-loaded-file size with the expected size, and the entire file is not completely there on disk yet.
In the WebAPI logic, I try rereading the file when detecting the entire thing is not being loaded, but the results are the same. However, a few hundred milliseconds later the entire file is there.
I don't want to sleep or delay returning my data when detecting the file is not completely on disk yet. I'd like to somehow force it to be written to disk. Because it's a closed source 3rd party tool writing the file, I can not go and add fflush() or the C++ equivalent to that code.
Also, I'm not running IIS. I'm running a secure WAMP variant called the UniServer. The closed source 3rd party tool is inside a DLL controlled by a C++ program I wrote, which is in turn controlled by a PHP web framework (Drupal) with custom WebAPI logic I also wrote. I include this information so you understand that this Windows Server is configured to operate as Linux/Unix like as possible.