Greetings,
The return value of the *system* 'exec' subroutine is an integer which
signifies if the command was able to be run, e.g., was there enough memory
allocated to read in the executable from the file system. The *system*
'exec' system subroutine if successful does not return and is usually
wrapped by fork and and wait; the macro language handles this for you.
Technically the return value from the command is an integer that is
returned by the program's 'main' routine; this may be what is returned by
the macro interpreter exec command (I do not know). What you are
interpreting as the output from the program is what the program writes to
stdin, or stderr in case of errors. Output to stdin, and stderr, can be
obtained by the system 'popen' subroutine; Java has access to this, and I
assume that the macro exec command uses this to copy the stdin(stderr?) to
the Log window. I do not know how to do this in the IJ macro language.
Enjoy,
Fred
On Sat, August 15, 2020 12:32 pm, Bill Christens-Barry wrote:
...
> I can invoke exiftool independently and see that the tag value has been
> written anew. But, oddly, I can't yet print the returned value to the Log
> window in ImageJ, even though the macro language doc indicates that the
> result of the exec() command is returned. This is also true if I
> explicitly assign the result returned from exec() to a string variable
> (e.g. str = exec(...)). I'm not sure why the success or failure result of
> writing the tag is printed to the ImageJ Log window, while the result
> returned upon reading that tag is not and is not assigned to a variable.
>
> Bill
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html