A variant of the streams idea

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Dec 26 07:29:56 AEST 1985


> Why do you lose "seekability"?  Pushing a protocol on top of a file
> potentially brings in a whole set of ioctl()'s that can be performed.
> So lseek() becomes ioctl(fd, FLSEEK, offset) or some such.  Other
> operations can be performed with similar ioctl()'s.

By the time you have made open() slip necessary protocol
modules onto disk files, etc. you end up with just another,
kludgier, implementation of the UNIX file system.

Streams work as nicely as they do because they are modeled
as full-duplex pipes with protocol "filters" inserted into
the pipeline.  Stream data comes from somewhere and goes
somewhere.  Disk files just sit; there is no inherent "flow".
File data is not normally "consumed", for example.  Now,
FIFOs and pipes are a different matter, and indeed pipes are
implemented using streams on 8th Edition UNIX.

One could certainly add features to ordinary files.  I once
thought up one, which Mike Karels told me had already been
invented and called "portals".  This would be code associated
with a file that would "fire up" when the file was accessed;
not too different from the idea of attaching protocol modules
to files.  Something like this might be worth doing,
especially for databasing, but not by stretching the stream
I/O system beyond its basic model.



More information about the Comp.unix.wizards mailing list