creat and open file methods have been finished.