read a file sync line by line