[Coco] Named pipes in OS-9/68K

Allen Huffman alsplace at pobox.com
Sat Apr 28 14:39:49 EDT 2007


Okay, here's how they work.

The named pipe has a size.  By default, it can hold 90 bytes (I  
think) but this could be changed in the descriptor. You can also  
specify the size when creating it (just like pre-allocating the size  
of a file on disk).

When a named pipe is created, you can write up to that much data,  
then it blocks because it is full.  Only when someone READS data from  
the pipe can you write more.  So, if you make a 1000 byte pipe and  
try to write 1010 bytes in to it, you block at 1000 written, then if  
someone reads one byte, you wake up and write one, and so on.

The reason you can use it for copy, etc. is because those utilities  
are just doing open/close/create/write/read calls inside, and pipes  
work with those calls -- Unified I/O in OS-9.

 From one terminal, you can do this:

dir >/pipe/dirpipe

Then from another shell, do

list /pipe/dirpipe

...and the data passes through.

Fun stuff.

		-- Allen




More information about the Coco mailing list