From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Cross Message-Id: <200109051422.KAA02761@augusta.math.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] weird print(2) problems... In-Reply-To: <20010904190825.3180.qmail@f.bio.cse.psu.edu> References: Cc: Date: Wed, 5 Sep 2001 10:22:18 -0400 Topicbox-Message-UUID: e9f0ea72-eac9-11e9-9e20-41e7f4b1d025 In article <20010904190825.3180.qmail@f.bio.cse.psu.edu> you write: >Hm. Pipes in Plan 9 preserve write boundaries, right? Print is probably >sending a zero length write, and confusing programs that interpret it >as eof. Hmm, that seems plausible. It's also rather annoying; it seems to me that if write(2) sees a zero length argument, it should consider that a nop and return. But then it seems that that would break some weird semantic somewhere (``Any write will update a timestamp; except for zero length writes, which are ignored.'' ``Dude, that's broken.'') Is there an elegant solution (other than ``don't do print("");'', since that might really mean ``don't do, read(0, str, 128); trimwhitespace(str); print("%s", str); where the only thing read is a blank line or something.'')? - Dan C.