def create_file(self):
        """
        Creates a file under the current directory.
        """
        src = self.get_current_path()
        name, status = QtWidgets.QInputDialog.getText(
            self.tree_view, _('Create new file'), _('File name:'),
            QtWidgets.QLineEdit.Normal, '')
        if status:
            fatal_names = ['.', '..', os.sep]
            for i in fatal_names:
                if i == name:
                    QtWidgets.QMessageBox.critical(
                        self.tree_view, _("Error"), _("Wrong directory name"))
                    return

            if os.path.isfile(src):
                src = os.path.dirname(src)
            path = os.path.join(src, name)
            try:
                with open(path, 'w'):
                    pass
            except __HOLE__ as e:
                QtWidgets.QMessageBox.warning(
                    self.tree_view, _('Failed to create new file'),
                    _('Failed to create file: %s') % str(e))
            else:
                self.tree_view.file_created.emit(os.path.normpath(path))
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/pyqode/core/widgets/filesystem_treeview.py/FileSystemHelper.create_file