fix filetostr and strtofile func ,add sample