[darcs-users] disposing of files (on win32)

Petr Rockai me at mornfall.net
Wed Jul 29 13:44:14 UTC 2009


although impossibility to delete open files on windows is a way to catch
descriptor leaks, it is also a source of constant problems. I have thought a
little about this, and would like to propose following:

When running on windows, have a _darcs/trash directory, and instead of calling
removeFile, we rename the file into _darcs/trash and provide an atexit handler
that removes anything in the trash. I have checked, that renaming a file is OK
even while it is open, on windows. We could provide a function to remove files
that would call removeFile on POSIX and rename on Win32. Is that a good idea?
(I do not insist, and currently there's no urgent need to do this, but it *may*
come handy in future.)


More information about the darcs-users mailing list