Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of run ? #57612

Open
ryofurue opened this issue Mar 3, 2025 · 2 comments · May be fixed by #57705
Open

Return value of run ? #57612

ryofurue opened this issue Mar 3, 2025 · 2 comments · May be fixed by #57705

Comments

@ryofurue
Copy link

ryofurue commented Mar 3, 2025

First of all, I'm totally new here and I apologize if I'm not doing this report/question properly . . .

As in

https://discourse.julialang.org/t/getting-hold-of-error-status-from-an-external-command/126465/

run() seems to return a Process object when the Cmd has ignorestatus=true. In the above discussion thread, however, we didn't find the feature documented. Does that mean that this feature is still experimental? or is it just a matter of (finding the) documentation?

@Octogonapus
Copy link
Contributor

It's not in a great spot but the exitcode field is the right way and it's documented here https://docs.julialang.org/en/v1/base/parallel/#Base.wait

@ryofurue
Copy link
Author

ryofurue commented Mar 7, 2025

the exitcode field is the right way

Nice!

But I haven't found the fact that run() returns a Process object documented. . . . While I'm writing this, I looked at the official documentation of run() again, this time much more carefully, and then found

"You can later wait for it and check its exit status by calling success on the returned process object."

"returned process object" !

Okay. It's extremely easy for a newcomer to miss this fact in the documentation.

If I knew how to edit the official documents and if I knew where to write it, I would explicitly write

  1. Without ignorestatus=true in the Cmd object, a failure in run(cmd) leads to a Julia exception.
  2. Exception or not, run() always returns a Process object and the exit code is found in the exitcode field of the object.

I know both can be inferred from the documentation if you piece together statements made at multiple places of the documentation, but it's very hard for a person who doesn't know how these functions and objects interact.

Octogonapus added a commit to Octogonapus/julia that referenced this issue Mar 10, 2025
@Octogonapus Octogonapus linked a pull request Mar 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants