NationalSecurityAgency/ghidra · error · IOException
{}: is not a directory
Error message
{}: is not a directory What it means
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.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:669
if (commitOption) {
// Generate and commit updates to BSim database
bsim.updateRepoSignatures(ghidraURL, xmlDirectory, overwriteOption, monitor);
}
else {
// Generate update XML files only
bsim.generateUpdatesFromServer(ghidraURL, xmlDirectory, overwriteOption,
configOption, monitor);
}
}
}
private File checkDirectory(String dirPath) throws IOException {
File dir = new File(dirPath);
if (!dir.exists()) {
throw new IOException("Commit directory does not exist: " + dirPath);
}
if (!dir.isDirectory()) {
throw new IOException(dirPath + ": is not a directory");
}
return dir.getCanonicalFile();
}
private void doCommitSigs(List<String> params, TaskMonitor monitor)
throws IOException, SAXException, LSHException, CancelledException {
if (params.size() < 1) {
throw new IllegalArgumentException("Missing directory containing signature files");
}
String xmlDirectory = params.get(0);
File dir = checkDirectory(xmlDirectory);
boolean hasOverride = optionValueMap.containsKey(OVERRIDE_OPTION);
String md5Filter = optionValueMap.get(MD5_OPTION);
try (BulkSignatures bsim = getBulkSignatures()) {View on GitHub (pinned to d5f144c24d)
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.
Example fix
# before bsim commitsigs postgresql://myhost/BsimDB /tmp/xmlout/sigs.xml # after bsim commitsigs postgresql://myhost/BsimDB /tmp/xmlout
Defensive patterns
Strategy: validation
Validate before calling
File dir = new File(dirPath);
if (dir.exists() && !dir.isDirectory()) {
throw new IOException(dirPath + " is a file, not a directory; pass the containing folder");
} Prevention
- Point at the folder containing XML files, never an individual file.
- Add a Files.isDirectory() guard in wrapper scripts.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Commit directory does not exist: {}
- Missing directory containing signature files
- Missing directory containing update files
- %s: error: @-file refers to a directory\n
- Unknown command: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/f5a4b09b60c1f662.
Report an issue: GitHub.