Re: Pipes and interprocess communication

From: Rufus V. Smith (nospam_at_nospam.com)
Date: 09/01/04


Date: Wed, 1 Sep 2004 16:56:09 -0400


"Krishna Monian" <KrishnaMonian@discussions.microsoft.com> wrote in message
news:FD8A86DF-0494-4B06-871B-4F0626DF04B3@microsoft.com...
> Hi All,
> I am writing an application which runs another application (passed as a
> command line argument) as a separate process. I redirect the stdout,
stderr
> and stdin of the process during creation as follows:
>
<program snipped>
>
> I then redirect the stdout of my program from the command line:
> myprog.exe > temp.txt 2>&1
>
> I also run the process separately and redirect its stdout and stderr to a
> file:
> process.exe > temp2.txt 2>&1
>
> However, some of the lines seem to go missing in the file created by
myprog.
> The original file created by the process is 15Kb in size. Hence, I think a
> buffer of 262144 should be enough for the pipe.
>
> Could anyone tell me what the problem could be?

Are you flushing your output at the end of myprog?

e.g. :

fflush(stdout);

Rufus



Relevant Pages

  • Re: last character of the last line is a newline?
    ... Would it be possible to redirect only to a file. ... output to standard output. ... # to stdout and to your_file ... Substitute your_program by the compound command of your original posting: ...
    (comp.unix.shell)
  • Re: How to create file with 0 bytes (length) ?
    ... and all that seems necessary is to run some command that writes ... nothing to STDOUT and redirect to a file. ... REM doesn't display anything to stdout. ...
    (comp.os.msdos.misc)
  • Re: Start a program and get a hold of its STDOUT and STDIN?
    ... one would just redirect it on the command line: ... > was examples of getting STDIN or STDOUT but not both at ... I need this to be in real time (when the ...
    (comp.lang.perl.misc)
  • Re: Cron Daemon backup message too big
    ... What this command does is to concatenate stdout + errors and redirect ... Could I avoid this by terminating the command line instead like this: ... though you need a redirect to the file too like so: ...
    (Debian-User)
  • Re: Redirecting lpt1 output to an installed printer
    ... to the lpt1 port. ... I am doing now is to redirect the output using the "net use" ... If there's a recognized printer on that port, ... which I do via a "net use LPT1" command inside a batch file. ...
    (microsoft.public.vb.general.discussion)