Hi all,
I maintain a small OCaml program that generates some data, writes it to a temporary file and creates another process, which then reads that temporary file. Recently, I've received a few reports from users that the program generates an empty file when it should not. All of the affected users run either 64bit Win7 or Win10. I have access to one of those users' machines, and I can reproduce the issue consistently, however I'm not able to reproduce the issue on any other machine.
The file io part looks something like following:
let oc = open_out_bin file in
output_string oc s;
close_out oc
The string "s" has non-zero size. The out channel has non-zero length and doing Unix.stat on the file after its closed shows non-zero size. However, both the newly created process and Windows see the file as empty after the program exits.
Any ideas on what might be happening?
Thanks,
Dmitriy