{"record":{"id":"f5a4b09b60c1f662","repo":"NationalSecurityAgency/ghidra","slug":"is-not-a-directory","errorCode":null,"errorMessage":"{}: is not a directory","messagePattern":"(.+?): is not a directory","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":669,"sourceCode":"\t\t\tif (commitOption) {\n\t\t\t\t// Generate and commit updates to BSim database\n\t\t\t\tbsim.updateRepoSignatures(ghidraURL, xmlDirectory, overwriteOption, monitor);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Generate update XML files only\n\t\t\t\tbsim.generateUpdatesFromServer(ghidraURL, xmlDirectory, overwriteOption,\n\t\t\t\t\tconfigOption, monitor);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate File checkDirectory(String dirPath) throws IOException {\n\t\tFile dir = new File(dirPath);\n\t\tif (!dir.exists()) {\n\t\t\tthrow new IOException(\"Commit directory does not exist: \" + dirPath);\n\t\t}\n\t\tif (!dir.isDirectory()) {\n\t\t\tthrow new IOException(dirPath + \": is not a directory\");\n\t\t}\n\t\treturn dir.getCanonicalFile();\n\t}\n\n\tprivate void doCommitSigs(List<String> params, TaskMonitor monitor)\n\t\t\tthrows IOException, SAXException, LSHException, CancelledException {\n\t\tif (params.size() < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Missing directory containing signature files\");\n\t\t}\n\n\t\tString xmlDirectory = params.get(0);\n\n\t\tFile dir = checkDirectory(xmlDirectory);\n\n\t\tboolean hasOverride = optionValueMap.containsKey(OVERRIDE_OPTION);\n\t\tString md5Filter = optionValueMap.get(MD5_OPTION);\n\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L651-L687","documentation":"Thrown as IOException by checkDirectory() when the path exists but is not a directory (e.g. it is a regular file). BSim expects a folder containing XML signature/update files, so a file path is invalid. The message interpolates the offending path.","triggerScenarios":"Running commitsigs or commitupdates where new File(dirPath).isDirectory() returns false (line 668) but the path exists — typically a file, symlink to a file, or a special device.","commonSituations":"Passing an XML filename instead of the containing directory; a symlink pointing at a file; the directory was replaced by a file of the same name.","solutions":["Point at the directory that contains the XML files, not at an individual file.","Run 'ls -ld <path>' to confirm it is a directory.","If the path is a symlink, resolve it and verify the target is a directory."],"exampleFix":"# before\nbsim commitsigs postgresql://myhost/BsimDB /tmp/xmlout/sigs.xml\n# after\nbsim commitsigs postgresql://myhost/BsimDB /tmp/xmlout","handlingStrategy":"validation","validationCode":"File dir = new File(dirPath);\nif (dir.exists() && !dir.isDirectory()) {\n    throw new IOException(dirPath + \" is a file, not a directory; pass the containing folder\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point at the folder containing XML files, never an individual file.","Add a Files.isDirectory() guard in wrapper scripts."],"tags":["cli","filesystem","bsim","commitsigs","commitupdates"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}