On Windows the collapsed file .collapsed.index.xml is not deleted. If I remove :force => true in cleanup_files() I see this error message:
C:/ruby-1.9.1-p376-i386-mswin32/lib/ruby/1.9.1/fileutils.rb:1298:in `unlink': Permission denied - C:/.collapsed.index.xml (Errno::EACCES)
I guess a not yet closed Windows handle makes it impossible to delete the file while the script is running. I can delete the file without a problem when the script has exited. I also made the script wait 10 seconds (with sleep) before it tries to delete the file - same problem. A quick fix is probably to create the collapsed file in the temp directory where all other files are created anyway? Admittedly, not a real fix - but then users don't need to manually delete the file all the time in their working directory.
Log in to post a comment.