'Check if file has been changed in any way outside Spyder:
1. removed, moved or renamed outside Spyder
2. modified outside Spyder'

def __check_file_status(self, index):

    if self.__file_status_flag:
        return
    self.__file_status_flag = True
    finfo = self.data[index]
    name = osp.basename(finfo.filename)
    if finfo.newly_created:
        pass
    elif (not osp.isfile(finfo.filename)):
        self.msgbox = QMessageBox(QMessageBox.Warning, self.title, (_('<b>%s</b>    is    unavailable    (this    file    may    have    been    removed,    moved    or    renamed    outside    Spyder).<br>Do    you    want    to    close    it?') % name), (QMessageBox.Yes | QMessageBox.No), self)
        answer = self.msgbox.exec_()
        if (answer == QMessageBox.Yes):
            self.close_file(index)
        else:
            finfo.newly_created = True
            finfo.editor.document().setModified(True)
            self.modification_changed(index=index)
    else:
        lastm = QFileInfo(finfo.filename).lastModified()
        if (to_text_string(lastm.toString()) != to_text_string(finfo.lastmodified.toString())):
            if finfo.editor.document().isModified():
                self.msgbox = QMessageBox(QMessageBox.Question, self.title, (_('<b>%s</b>    has    been    modified    outside    Spyder.<br>Do    you    want    to    reload    it    and    lose    all    your    changes?') % name), (QMessageBox.Yes | QMessageBox.No), self)
                answer = self.msgbox.exec_()
                if (answer == QMessageBox.Yes):
                    self.reload(index)
                else:
                    finfo.lastmodified = lastm
            else:
                self.reload(index)
    self.__file_status_flag = False
