[erlang-bugs] Bug in file I/O under Windows.

Richard Carlsson richardc@REDACTED
Mon Mar 10 12:15:38 CET 2008


John Hughes wrote:
> On my Vista machine, it took about three quarters of a million iterations to
> provoke a test failure.

The problem might be concurrent access by some other interfering program.
I believe (someone correct me if I'm wrong) that under Windows, the default
way of opening files for reading is exclusive (yes, even for read-only).
This way, programs such as virus checkers and other things that traverse
your file system for one reason or another (notably TortoiseSVN), can
occasionally happen to prevent you from performing an operation even on
a file that you just created and nobody is supposed to know about yet.

I'm not 100% sure that this is really what is happening, but it's our best
hypothesis so far. We often see spurious failures when unzipping archives
with loads of files, or sometimes when checking out big source trees from
the repository. Only in Windows(TM). Oh, joy!

    /Richard

PS. What seems to be happening with unzip is this: unzip creates the file
and populates it from the archive data, then closes it again. Then, as a
separate operation it wants to set the timestamp to whatever it was in the
archive. But, meanwhile, some greedy program is already checking out the new
file, and we get error reports stating that the date could not be set. Gah!





More information about the erlang-bugs mailing list