[J3] execute_command_line error condition clarification
Daniel Chen
cdchen at ca.ibm.com
Tue Mar 3 13:54:28 UTC 2026
Hello,
The standard says the following about the CMDSTAT argument of intrinsic EXECUTE_COMMAND_LINE.
```
CMDSTAT (optional) shall be a scalar of type integer
….
a processor-dependent positive value if an error condition occurs,
…
Otherwise it is assigned the value 0.
```
What is considered as an “error condition” in this context?
Consider the following sample code:
```
integer :: e = 0
integer :: c = 0
call execute_command_line("cat nofile", exitstat=e, cmdstat=c)
print *, e
print *, c
end
```
Should “cat nofile” be considered as an error condition if “nofile” doesn’t exist?
Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20260303/849a9fa1/attachment.htm>
More information about the J3
mailing list