[darcs-devel] [issue2431] darcs leaves empty files in repo

Ben Franksen bugs at darcs.net
Fri Feb 20 23:48:38 UTC 2015


Ben Franksen <benjamin.franksen at helmholtz-berlin.de> added the comment:

We are using openBinaryTempFile in an unsafe manner here: the file gets
closed immediately inside withTemp, then, in the user specified closure
we reopen it and close it again (by calling copyFileOrUrl on the
filename). I guess openBinaryTempFile operates under the assumption that
after the file handle it returns is closed the caller is done with it
and the name can be re-used. I can reproduce this with a simple test
program where I get the same file name 20 times in a row.

Fixing this will require some refactoring.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2431>
__________________________________


More information about the darcs-devel mailing list