Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: reliable reads from pipes Message-ID: <13483@smoke.BRL.MIL> Date: 5 Aug 90 02:17:27 GMT References: <1990Aug3.233256.29659@NCoast.ORG> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 7 In article <1990Aug3.233256.29659@NCoast.ORG> atul@NCoast.ORG (Atul Parulekar) writes: >but sometimes it does not print out the full directory name (prints (/) ... "pwd" doesn't necessarily print its entire output in a single atomic write(), so your read() on the pipe may return only a portion of what "pwd" will eventually have written. The simplest solution is to read until you see a new-line, which will be the last thing output by "pwd".