Use perrorMsg instead of perror and keep removing files if we encounter
an error.
3 files changed