July 23, 2014 Re: Grabing C(++) stdout | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris | On Wednesday, 23 July 2014 at 15:30:53 UTC, Chris wrote:
> Redirect it from stdout to somewhere else.
It might be writing to stderr instead of stdout... does anything change if you reopen stderr too?
|
July 24, 2014 Re: Grabing C(++) stdout | ||||
---|---|---|---|---|
| ||||
Posted in reply to FreeSlave | On Wednesday, 23 July 2014 at 16:46:04 UTC, FreeSlave wrote:
> On Wednesday, 23 July 2014 at 15:35:59 UTC, Chris wrote:
>> The C++ code does this:
>>
>> size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );
>> // stream is stdout
>>
>> and text appears in the console (a string).
>>
>> I don't how to grab the text that is written to console. I might have to redirect it from within the C++ code.
>
> I've created simple example (for Linux) - https://bitbucket.org/FreeSlave/redirect-example/src
> It works as expected. Nothing writes to console, but to file.
@FreeSlave
Thanks a million, just tried it, this one fixed it for me. My mistake was to use std.stdout instead of std.c.stdio.stdout (I thought they were the same). Next I'll see, if there's a way I can grab it directly without referring to a text file.
|
Copyright © 1999-2021 by the D Language Foundation