datafile_handling: don't open unnecessary file