block read and write file.