delete com.file only when we are about to actually generate things (closes #3111)