fix write \n before tree text
halfly rewrite file_util.c