Create output files only if input file is successfully opened