On 1 March 2011 18:28, Ian Thomas <il.tho...@iinet.net.au> wrote:
> (prev reply went to DC alone)
>
> Odd, as David suggested, redirecting stderr gets what I want whereas
> synchronous stdout redirection collects zilch. I can live with a useable
> result, but I don’t understand the behaviour.
>

Unix command line apps often print to stderr instead of stdout so the
app's stdout can be piped along to the next piece of the puzzle.

The smarter apps can detect if stdout has been redirected or not and
print to stdout instead if it hasn't (using the isatty function in C).

>
> ________________________________
>
> Ian Thomas
> Victoria Park, Western Australia
>
> ________________________________
>
> From: David Connors [mailto:da...@codify.com]
> Sent: Tuesday, March 01, 2011 1:39 PM
> To: ozDotNet
> Cc: Ian Thomas
>
> Subject: Re: Get version of native Windows 32 executable
>
>
>
> On 1 March 2011 15:30, Ian Thomas <il.tho...@iinet.net.au> wrote:
>
> With this particular MinGW application, there is a commandline argument to
> redirect stdoutput – using > doesn’t work. And I have found that I have to
> open a cmd box (in code) to get the –h (help) to work!
>
> So, my work-around had been (and still is, since I can’t get anything from
> Process.StartInfo.RedirectStandardOutput) to create a text output file and
> read it.
>
> The output might be going out stderr. Try redirecting that instead.
>
> Unfortunately, I can’t recompile the C source code for the FOSS utility
> since it uses variable-length arrays.
>
> Send me the source in a zip as I have the entire G++/MinGW/Qt infrastructure
> on my laptop at the moment. I'll see if it builds and if so we can discuss
> how much beer you're going to send me to embed a version resource for you.
>
>
>
> That said, can't you just open the exe in a resource editor and type one
> in?
>
>
>
> David.
>
>
>
> --
> David Connors | da...@codify.com | www.codify.com
> Software Engineer
> Codify Pty Ltd
> Phone: +61 (7) 3210 6268 | Facsimile: +61 (7) 3210 6269 | Mobile: +61 417
> 189 363
> V-Card: https://www.codify.com/cards/davidconnors
> Address Info: https://www.codify.com/contact

Reply via email to