]> arthur.barton.de Git - bup.git/commit
midx: close the mmap before erasing an midx file
authorPatrick Rouleau <prouleau72@gmail.com>
Thu, 22 May 2014 03:36:27 +0000 (23:36 -0400)
committerRob Browning <rlb@defaultvalue.org>
Wed, 28 May 2014 16:53:56 +0000 (11:53 -0500)
commit0430ecff35e1d9dfee3dc74574f41be20299bca9
tree55cb37b5da4524ce03a07ae76c2ce921ddafbc08
parent0c4ba8efc5da8ee9ce03595ef3b7426158166aa5
midx: close the mmap before erasing an midx file

Linux allows erasing a file even if it is still memory mapped, but
Windows does not. However, Cygwin tries to emulate Linux and, under
certain conditions, it silently moves the file to $RECYCLED.BIN/, but
not in a way where Windows takes care of it when we use the "empty the
recycled bin" command. The erased midx ends up comsuming more and more
disk space.

To solve this, we have to close the midx's mmap before erasing
the midx.

Cygwin users: you can use this command to clean up your
$RECYCLE.BIN/ directories:
find /cygdrive/?/\$RECYCLE.BIN/ -name "\.???[[:xdigit:]]*" -print -delete

Signed-off-by: Patrick Rouleau <prouleau72@gmail.com>
[rlb@defaultvalue.org: adjust commit message]
lib/bup/git.py
lib/bup/midx.py