add lseek in open(), let file pointer point to beginning of file.
now don't have to move file pointer before read file.