g_spawn: where is the other stdout?



Hello,

I'm trying to capture programs standard output with simple

  g_spawn_sync(NULL, args, NULL, 0, NULL, NULL,
               &buffer, NULL, &exit_status, &err);

both on Linux and Windows.  On Linux everything works fine.
On Win98 capturing works fine too (if things don't break
totally, but this seems to be other problem).

However on WinXP I sometimes don't receive anything in the
buffer in spite of the program printing something.

I can capture output of
- console C programs (MSVC compiled, printing with libc
  functions),
- the `echo' command.

I canNOT capture output of
- console Delphi programs printing with WriteLn()
  (though output of identical program compiled with fpc on
  Linux can be captured, moreover, output of identical
  binary running on Win98 can be captured),
- the `type' command.

I thought the resiting programs write directly to the
terminal somehow (like writing directly to a tty on *nix),
but their output can be redirected to a file with >file and
otherwise look like normal stdout.  I really don't know
where they print to.

Is there any chance to get their output with g_spawn_...()?
If not, what should I use instead?  And if have control over
the programs, how do I make them print to `the right stdout'
g_spawn_...() can capture?  (If there is any such thing
generally).

TIA,

Yeti


--
Do not use tab characters. Their effect is not predictable.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]