Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!lll-winken!sun-barr!newstop!sun!wind.Eng.Sun.COM From: naughton@wind.Eng.Sun.COM (Patrick Naughton) Newsgroups: comp.windows.news Subject: Re: NeWS pipe operator Message-ID: <140767@sun.Eng.Sun.COM> Date: 16 Aug 90 17:05:37 GMT References: <1990Aug16.092727.4712@canon.co.uk> Sender: news@sun.Eng.Sun.COM Reply-To: naughton@wind.Eng.Sun.COM (Patrick Naughton) Organization: Sun Microsystems, Inc. - Mountain View, CA Lines: 41 In article <1990Aug16.092727.4712@canon.co.uk>, smith@canon.co.uk (Mark Smith) writes: |> In OW 2.0, there's a NeWS 'pipe' operator, to replace that weird |> %pipe trick in the the 'file' operator. Is there documentation |> somewhere as to exactly how it works? It appears that if you do |> something like |> |> (/usr/games/fortune) pipe |> |> two file objects are returned. The read-only stdout file contains |> the output as you'd expect, but I can't see why there's also a |> write-only (stdin?) file on the stack. I must be missing something |> he said, clueless. |> |> More generally, is there documentation for changes since the NeWS 2.0 |> Programmer's Guide came out? You guessed it, the input file is stdin to the pipe. Here's a simple example of using the /bin/sort filter to sort a couple of strings... %! (/bin/sort) pipe /o exch def /i exch def o (baby\nzulu\nabc\nsun\n) writestring o flushfile o closefile i 100 string readstring pop == i closefile The NeWS 2.1 programmers guide should document all of the new operators. -Patrick ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@sun.com Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080