Skip to content

Conversation

gemesa
Copy link
Contributor

@gemesa gemesa commented May 5, 2025

While following the GhidraProject openProgram API docs, I got this error when trying to call openProgram on Windows like this:

program = project.openProgram("\\", domainFile.getName(), true)
java.lang.IllegalArgumentException: Absolute path must begin with '/'
        at ghidra.framework.data.DefaultProjectData.getFile(DefaultProjectData.java:663)
        at ghidra.base.project.GhidraProject.openProgram(GhidraProject.java:303)

So turns out it should be "/" under both Linux and Windows. I also tested it in both cases and it works.

@ryanmkurtz
Copy link
Collaborator

That is a project path, which is OS-indepenent and always uses the forward-slash notation. The javadoc is just wrong...i'll fix it, thanks!

@ryanmkurtz ryanmkurtz self-assigned this May 5, 2025
@ryanmkurtz ryanmkurtz added Feature: Documentation Status: Internal This is being tracked internally by the Ghidra team labels May 5, 2025
@ryanmkurtz ryanmkurtz added this to the 11.4 milestone May 5, 2025
@ryanmkurtz ryanmkurtz closed this in 67837ab May 5, 2025
@ryanmkurtz
Copy link
Collaborator

Oops, i didn't realize this was a PR so i fixed it myself.

@gemesa
Copy link
Contributor Author

gemesa commented May 5, 2025

Not a problem at all.

@gemesa gemesa deleted the ghidraproject-openprogram branch May 5, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Documentation Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants