def _update_file(self, seek_to_end=True):
        """Open the file for tailing"""
        try:
            self.close()
            self._file = self.open()
        except IOError:
            pass
        else:
            if not self._file:
                return

            self.active = True
            try:
                st = os.stat(self._filename)
            except EnvironmentError, err:
                if err.errno == errno.ENOENT:
                    self._log_info('file removed')
                    self.close()

            fid = self.get_file_id(st)
            if not self._fid:
                self._fid = fid

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