Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!samsung!munnari.oz.au!uokmax!d.cs.okstate.edu!unx2.ucc.okstate.edu!minich From: minich@unx2.ucc.okstate.edu (Robert Minich) Newsgroups: comp.sys.mac.misc Subject: Re: System 7.0 vs. NeXT Step Message-ID: <1991Jan24.193223.3085@unx2.ucc.okstate.edu> Date: 24 Jan 91 19:32:23 GMT References: Distribution: comp Organization: Oklahoma State University Computer Center Lines: 54 Me: | No. Pipes don't make a lot of sense without stdin and stdout, do | they? :-) by jeremy@cs.swarthmore.edu (Jeremy Brest): | I guess I don't follow you. This is a quote of the pipe(2) man page: | | (NAME | ( pipe - create an interprocess communication channel | ( | (SYNOPSIS | ( pipe(fildes) | ( int fildes[2]; | ( | (DESCRIPTION | ( The pipe system call creates an I/O mechanism called a pipe. | ( The file descriptors returned can be used in read and write | ( operations. When the pipe is written using the descriptor | ( fildes[1] up to 4096 bytes of data are buffered before the | ( writing process is suspended. A read using the descriptor | ( fildes[0] will pick up the data. This is great and all but I think the most common use of pipes is to take the stdout of one program and pipe it to the stdin of another: grep gottafindit mydbfile | sort would take to tools that seperately may not be terribly great and makes the combination very useful. Since the concept of stdin/out on the Mac doesn't exist, this use of pipes is useless. If you want to use pipes as an IPC mechanism, I'd suggest you try something else on a Mac. Like the sys 7 PPC routines. You might also consider AppleTalk or shared memory, depending on your requirements. For me, the best part about pipes is the ability to string together various programs to manipulate data streams. I can't remember the last time I felt the need to connect two programs using the pipe system call. However, piping through a command line with a shell is really useful and I have at times had really long pipelines. For example, the pbm plus toolkit contains a bunch of simple utilities to manipulate graphics files including converting formats and doing various image manipulations (zoom, rotate, clip, quantitize colors). I can feed the output from a ray tracer through theses tools and end up with a GIF file at the end without bothering with intermediate files. rayshade inputfile | mtvtoppm | ppmquant 256 | ppmtogif > outfile.gif Unfortunately, the *ppm* programs read in whole files at a time so I don't get the benefit of having them all operate in parallel but I do eliminate those pesky pixel data files (24bit color at 512x512 is a lot of spacem especially when you have extra files hanging around!) -- |_ /| | Robert Minich | |\'o.O' | Oklahoma State University| "I'm not discouraging others from using |=(___)= | minich@d.cs.okstate.edu | their power of the pen, but mine will | U | - "Ackphtth" | continue to do the crossword." M. Ho