create output file only if input file opens correctly