Use rewind instead of fseek in parse_file function