File buffering

Teemu Ikonen tpikonen at
Thu Jan 18 09:36:04 CST 2007

On 1/18/07, Damjan Jovanovic <damjan.jov at> wrote:
> On 1/17/07, Teemu Ikonen <tpikonen at> wrote:
> If you don't wait for the forked process to finish before deleting the
> file, then you have a bug called a race condition which apparently
> manifests in wine and not in Windows: you're relying on the forked
> process to open the file before it gets deleted.

I know and I'm a bit surprised it actually works under windows as well
as it does. This program is used extensively under various (modern)
versions of windows, and it never fails this way.

I agree this type of code is rather ugly and even incorrect (it's not
my code, I just have access to it), but I assume the wine project is
aiming for bug-for-bug compatibility with windows? Probably this kind
of bug is hard to fix though, as this code relies on the windows
scheduler giving the new process a rather large slice of CPU time
before returning to the forking process.


More information about the wine-devel mailing list