sqlmapproject/sqlmap · error · SqlmapSystemException

unable to write to the temporary directory ('%s'). Please ma

Error message

unable to write to the temporary directory ('%s'). Please make sure that your disk is not full and that you have sufficient write permissions to create temporary files and/or directories

What it means

Error "unable to write to the temporary directory ('%s'). Please make sure that your disk is not full and that you have sufficient write permissions to create temporary files and/or directories" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/core/target.py:654

        conf.resultsFile = conf.resultsFile or os.path.join(paths.SQLMAP_OUTPUT_PATH, time.strftime(RESULTS_FILE_FORMAT).lower())
        found = os.path.exists(conf.resultsFile)

        try:
            conf.resultsFP = openFile(conf.resultsFile, "a", UNICODE_ENCODING, buffering=0)
        except (OSError, IOError) as ex:
            try:
                warnMsg = "unable to create results file '%s' ('%s'). " % (conf.resultsFile, getUnicode(ex))
                handle, conf.resultsFile = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.RESULTS, suffix=".csv")
                os.close(handle)
                conf.resultsFP = openFile(conf.resultsFile, "w+", UNICODE_ENCODING, buffering=0)
                warnMsg += "Using temporary file '%s' instead" % conf.resultsFile
                logger.warning(warnMsg)
            except IOError as _:
                errMsg = "unable to write to the temporary directory ('%s'). " % _
                errMsg += "Please make sure that your disk is not full and "
                errMsg += "that you have sufficient write permissions to "
                errMsg += "create temporary files and/or directories"
                raise SqlmapSystemException(errMsg)

        if not found:
            conf.resultsFP.writelines("Target URL,Place,Parameter,Technique(s),Note(s)%s" % os.linesep)

        logger.info("using '%s' as the CSV results file in multiple targets mode" % conf.resultsFile)

def _createFilesDir():
    """
    Create the file directory.
    """

    if not any((conf.fileRead, conf.commonFiles, conf.xxe)):
        return

    # Note: normalize the hostname consistently with conf.outputPath / conf.dumpPath (see _createDumpDir)
    conf.filePath = paths.SQLMAP_FILES_PATH % normalizeUnicode(getUnicode(conf.hostname))

    if not os.path.isdir(conf.filePath):

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/core/target.py:654 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/e6da6b380ba75cd3. Report an issue: GitHub.