Ben Dugan on 31 Oct 2006 20:24:46 -0000


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

Re: [PLUG] Basic unix pipe question


Jeff Abrahamson wrote:

The pipe is buffered. So writes to the pipe by program1 don't actually get written until enough is in the buffer.

In your sample program, add "fflush(stdout);" after each write. It should do what you expect.

The other way to do this is to use ioctl (I think) to set the file descriptor to be unbuffered.


Thanks, Jeff. I added an fflush after Dan suggested it and it worked well for my purposes.

Ben
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug