Menu

#1 w32 file unlocking

open
nobody
RSS Parsing (1)
5
2004-03-01
2004-03-01
Anonymous
No

The msvcrt locking function locks from the _current_
file pos.

In load_recompiled you lock the file at pos 0, then
load the pickled file. Then the unlock can sometimes
fail cause the file pos is now somewhere else.

Reproduce this by running the script twice on a widows
box. It will fail the second time with IOException,
error 13.

I fixed this by saving the current file position and
telling to the start of the file when un/locking files,
then restoring the file pos.

You may have already fixed this. I got the source from
the tar ball on your home page, and it is quite old.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB