Set the modified and access time on output files to be the same as source files. Refactor to not repeat myself in error blocks.