Web lists-archives.com

Re: [Mingw-users] Getting error message in a file




[Please do not top post; it is considered rude here]

On 27/12/15 20:34, Vincent Lesbros wrote:
>>> Is there an option to tell the compiler to send errors in a
>>> specified file in the command line ?
>>
>> No, not AFAIK.  But you can write a batch file in which you invoke
>> GCC with stderr redirected via "2> FILE", and then invoke that
>> batch file via ShellExecuteW.
>
> Ok, this is apparently the only way.

It may be the simplest way, although some may consider it to be untidy.
Is it not possible to open(), or to popen(), an output stream in the
parent process, then bind it to STDERR_FILENO with dup2(), *before*
calling ShellExecuteW()? That's the normal (programmatic) way to set up
I/O redirection, and it is, after all, what the shell itself most likely
does, when it processes "2> FILE".

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe