Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!aplcen!haven!adm!xadmx!00499@vax1.acs.udel.edu From: 00499@vax1.acs.udel.edu (WEAVERLING) Newsgroups: comp.unix.questions Subject: Unbuffering pipes Message-ID: <21156@adm.BRL.MIL> Date: 16 Oct 89 04:10:00 GMT Sender: news@adm.BRL.MIL Lines: 22 I am attempting to write my first UNIX C program and all went well except for one glitch. I am using popen() on sar. The program uses sar to collect usage statistics based on two params, first specifies the time period and the second specifies how many samples to take. The program then dresses up the output from sar (using curses routines). My problem is the pipe is buffered (BUFSIZ=1024 on my box), so I don't get data through the pipe until a few time periods have passed (... when the buffer fills). I've tried using fflush() and setbuf(), but have had no success. I assume that unbuffering must be possible, since sar invokes sadc, which outputs binary data to stdout. My box (a Prime EXL 325) runs Sys V 3.1 Any clues? Many thanks! Ken Weaverling +1 302 573 5460 | "OS/2 is like AIDS Delaware Technical & Community College | They say millions have it 00499@vax1.acs.udel.edu | You don't know anyone that's got it weave@pyr1.acs.udel.edu | And you pray to God you don't get it"