Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: Inline: where did the output go?

by andye (Curate)
on Jun 12, 2007 at 14:25 UTC ( #620734=note: print w/replies, xml ) Need Help??

in reply to Re: Inline: where did the output go?
in thread Inline: where did the output go?

Hi cdarke,

I'm trying to work up a minimal example to show the problem - the issue I've got now is that when I make the example very minimal, the problem goes away. :)

You may be right that it's a buffering problem though: I've written an example script which prints a line from Perl, then a line from C, then a line from Perl. On my Mac the lines appear in the file in the expected way, but on the Linux machine where I've originally found the problem, they appear in this order:
1 Perl
3 Perl
2 C
(should be 1 Perl, 2 C, 3 Perl)

and putting a fflush(stdout) in the right place solves that problem...

...ok, so let's try doing that in the real script... success! Hooray!

Triple++ (if I could) to cdarke, and many thanks.

Best wishes, andye

Replies are listed 'Best First'.
Re^3: Inline: where did the output go?
by Anonymous Monk on Jun 12, 2007 at 14:36 UTC
    Hummm. Not sure I deserve that. The buffer should be flushed on exit from the program, regardless of whether it goes to the screen or a file.
      Ah, but (and I should maybe have mentioned this before) the process runs for a long time, i.e. a couple of days.

      It's a long batch-processing job. (That's why I'm using Pdlpp to code part of it, because I need to get up to C speed otherwise it takes forever).

      - need to get output during the program run, as the point of the output is to show progress.
      - when I've been testing it to see if anything was showing up in the output file, I've been waiting a while and when nothing appeared I've been killing the process.

      Best wishes, andye

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://620734]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2018-05-26 18:23 GMT
Find Nodes?
    Voting Booth?