For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > November 2005 > Re: output of a program differs when the result of the program is directed to a file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: output of a program differs when the result of the program is directed to a file
budyanto.himawan@gmail.com

2005-11-29, 3:57 am

One way to fix this is, as mentioned before, to do an fflush() on
stdout before fork().

Another way is to explicitly set the buffering mode using setvbuf().

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com