update buf & file type