strider1551 / djvubind

Combine multiple image files into an optimally compressed djvu file.
19 stars 6 forks source link

Implement temporary files #2

Open strider1551 opened 10 years ago

strider1551 commented 10 years ago

Djvubind can produce a large number of temporary files as it works. Presently these simply exist in the working directory and are deleted manually. Instead, we should take advantage of the tempfile module. It's cross-platform and it cleans up the files in the event of an unhandled exception. Also, some people have hardware configurations designed for better handling of temporary files (e.g., I have /tmp/ mounted as a ramdisk to save wear and tear on the real hard drive).

References: http://docs.python.org/dev/library/tempfile.html#module-tempfile