Mailing List Archive


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

Re: [tlug] stdout redirection



> I have a (C) program ("myprog") which outputs messages to stdout and
> stderr while running. ...
> 1) In the case the program does not return (i.e., waiting for a
> message or something, need to use Ctrl-C to terminate it),
> log_stdout.txt is empty 

You need to flush stdout (e.g. fflush(); or fflush(stdout);) to be sure
all the output has gone. (Or switch off buffering, but flushing is easier).

Darren



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links