Clean up temporary files/dirs as you go, instead of in the end
Diffoscope used to leave countless of empty temporary files and directories under TMPDIR. In case of the file system running out of inodes, it cleaned them up and exited with no other indication other than the message:
No space left on device. Diffoscope exiting.
It is easy to simulate the error by mounting TMPDIR as a tmpfs filesystem with option nr_inodes=100, and then comparing two identical directories with more than 100 files.
With this merge request, most frequent offenders are changed to be auto-cleaned-up by the object destructor, once the object is garbage collected.
Edited by Dimitrios Apostolou