Path: utzoo!utgpu!watmath!clyde!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: end of file characters and open file descriptors Message-ID: <7330@chinet.chi.il.us> Date: 30 Dec 88 15:52:04 GMT References: <1345@cod.NOSC.MIL> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 18 In article <1345@cod.NOSC.MIL> waagen@cod.nosc.mil.UUCP (Don E. Waagen) writes: > > I'm trying to have two processes communicate via a pipe (stdout), like > > A | B > >but with a small difference. Process A will never die (i.e. the connection >will never be closed). What I would like to do is have the fread and getchar() >calls of process B sense or think that it is seeing the pipe close (i.e. an EOF >character returned by the calls) without closing the connection. If you have SysV style FIFO's (named pipes) the programs can actually do the open/close. In any case, though, you could send an agreed-upon character or sequence as a terminator. Or is the real problem the stdio buffering keeping B from seeing anything until a block is filled and flushed? If that is the case, just use read() and write() instead of the buffered versions. Les Mikesell