@MortenMacFly
BTW: I just looked at you patch: I still don't believe you need an additional function. I thought you'd do it by extending the existing one?!
I had not read the correction message!, but of course this is possible.
I have considered your suggestion.
In my case 'stderr' can give me an ERROR or just a WARNING without error.
But it is the reading 'stderr' can I know!
If it's only a warning, I also need to read 'stdout'.
If it is an error, 'sdtout' will be empty.
This is why I commented on the 'else'.
In this version, I can either get or not the errors / warnings
With the command, I can always choose to use 'stdout or not
wxString ExecuteAndGetOutputAndError(const wxString& command, bool prepend_error = false)
{
if (!SecurityAllows(_T("Execute"), command))
return wxEmptyString;
wxArrayString output;
wxArrayString error;
wxString str_out;
wxExecute(command, output, error, wxEXEC_NODISABLE);
// first 'stderr'
if (prepend_error && !error.IsEmpty())
str_out += _T("stderr :\n") + GetStringFromArray(error, _T("\n"));
//else
if (!output.IsEmpty())
str_out += _T("stdout :\n") + GetStringFromArray(output, _T("\n"));
return str_out;
}