Fix error on truncate when file does not yet exist