Either add temp files to cleanup to a list in cleanup() or create a unique mktemp directory to save all files and remove this directory in cleanup()
Either add temp files to cleanup to a list in cleanup() or create a unique mktemp directory to save all files and remove this directory in cleanup()