def _update_file(self, seek_to_end=True):
try:<EOL><INDENT>self.close()<EOL>self._file = self.open()<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if not self._file:<EOL><INDENT>return<EOL><DEDENT>self.active = True<EOL>try:<EOL><INDENT>st = os.stat(self._filename)<EOL><DEDENT>except EnvironmentError as err:<EOL><INDENT>if err.errno == errno.ENOENT:<EOL><INDENT>self._log_info('<STR_LIT>')<EOL>self.close()<EOL><DEDENT><DEDENT>fid = self.get_file_id(st)<EOL>if not self._fid:<EOL><INDENT>self._fid = fid<EOL><DEDENT>if fid != self._fid:<EOL><INDENT>self._log_info('<STR_LIT>')<EOL>self.close()<EOL><DEDENT>elif seek_to_end:<EOL><INDENT>self._seek_to_end()<EOL><DEDENT><DEDENT>
Open the file for tailing