Add cutfile method and fix the file method