[comp.windows.news] NeWS pipe operator

smith@canon.co.uk (Mark Smith) (08/16/90)

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?

=========================================================================
 Mark Smith                                            smith@canon.co.uk
 Canon Research Centre Europe                   ..ukc!uos-ee!canon!smith
-------------------------------------------------------------------------
 soft driven slow and mad like some new language

naughton@wind.Eng.Sun.COM (Patrick Naughton) (08/17/90)

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