load file, delete file and write file