LAUNCH EXTERNAL PROCESS (Why does "errorStream" argument return all info?)

The<https://doc.4d.com/4Dv17R5/4D/17-R5/LAUNCH-EXTERNAL-PROCESS.301-412
701.en.html> LAUNCH EXTERNAL PROCESS> 4D command has these
5-parameters:

( fileName {; inputStream {; outputStream {; errorStream}}}{; pid} )

Why is all information returned in the errorStream parameter instead
of the outputStream parameter, when I use the “xcrun altool
–notarization-info” command?

So calling:

<code 4D>
$explain_c.push(New object(“start”;String(Current time;HH MM
SS);“end”;""))

$command_t:=“xcrun altool --notarization-info”
``+Char(Space)
+$jobID_t
+Char(Space)
+"–username “jeremyfrench@mac.com”"
+Char(Space)
+"–password “@keychain:altool-notarize”"

LAUNCH EXTERNAL PROCESS($command_t;$input_t;$output_t;$error_t)

$explain_c[0].end:=String(Current time;HH MM SS)
$explain_c.push(New object(“OK”;OK))
$explain_c.push(New object("$input_t";$input_t))
$explain_c.push(New object("$output_t";$output_t))
$explain_c.push(New object("$error_t";$error_t))
$explain_c.push(New object("$command_t";$command_t))
</code 4D>

returns the reply in the errorStream (ie, $error_t). The outputStream
(ie, $output_t) is an empty string.

Here’s what $explain_c reports. Note all information sent back is in
$error_t. But no errors occurred (see red):

[
{
“start”: “10:09:55”,
“end”: “10:10:00”
},
{
“OK”: 1
},
{
“$input_t”: “”
},
{
“$output_t”: “”
},
{
“$error_t”: “2019-07-05 10:10:00.337 altool[840:57217] No
errors getting notarization info.\n\n RequestUUID:
118fcb15-5d88-40e3-a0cd-c139313b9895\n Date: 2019-07-05
01:33:24 +0000\n Status: success\n LogFileURL:
https://osxapps-ssl.itunes.apple.com/itunes-assets/Enigma113/v4/97/75/
3/9775336b-dac7-b906-8a5b-479f63cd51ac/developer_log.json?accessKey=15
2530200_3364103213007563022_qdx1DYpo6QFo2wxuz57wIerNRVQ3tazX%2BMB9oWfX
a1fDr3l8W%2BHa8%2FAoyN9uxUb2p5vfvyBP9oVJEKesoePVGcqNIFOJiFXcJGZdEgEgGR
GUmsZPhRQLH6FKs0wMZyFmyd0fSD07dwCnn1%2BB%2B53vRVHgCzJce00RSkf3dDnyE%3D
n Status Code: 0\nStatus Message: Package Approved\n”
},
{
“$command_t”: “xcrun altool --notarization-info
118fcb15-5d88-40e3-a0cd-c139313b9895 --username
jeremyfrench@mac.com” --password “@keychain:altool-notarize””
}
]

Why – when there are no errors – is the reply returned in the errorStream argument? (I would have thought the reply would appear in the outputStream.)

QUESTIONS:

I don’t know much about the xcrun tool. But it could be that this tool returns all output into the error stream.
You can easily test this e.g.

If you see any output in the 2nd case only, xcrun uses the error stream only.

HTH

Regards
Lutz

xcrun is a redirection utility that finds CLI tools inside Xcode.

it is not uncommon for developer to have multiple versions of Xcode installed,
or one installed in a non-standard directory.

I agree that it is the CLI program (altool in this example)
that decides what to print in stdErr and what to print in stdOut.
LAUNCH E. P. is simply echoing the output.

some commands prefer to use stdErr to report progress, not error,
presumably to prevent stdOut from being clogged with information.

by the way, altool creates its own log file in ~/Library/Application Support/altool/