fail1 and fail2 can be the same file.