[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Channel concept instead of simple Files
On Fri, 12 Jan 96 9:00:55 EST acken@informatik.uni-kl.de (you) wrote:
> > From: Sander van der Wal <svdwal@xs4all.nl>
> > Date: Fri, 12 Jan 1996 11:54:44 +0100
> >
> > ...
> > There is another factor to take into account, there is a difference
> > between for instance a disk file and the keyboard.
[knip]
>
> Unix, and AFAIK AmigaOS, simply spend the file descriptor (stream,
> channel, or whatever) additional attributes and/or prevent a function
> that needs a specific feature from being used. For example the Unix
> pipes and FIFOs don't allow lseek() and make it return with an error
> code. A simple solution to this problem is to add an "is
> positionable" flag to the channel, similar to the "is readable" and
> "is writable" flags.
RISC OS does something similar with the file descriptor. Unix really
has a large influence ;-).
I find the use of a 'is positionable' flag a bit of a hack.
If there are two kinds of channels, a positionable one and a sequential
one, I can immediately deduct some properties of the algorithm that
uses a paricular kind of channel. Take for instance a backend for ooc:
if the channel is sequential, I immediately know that either the code
generator is sequential too, or that it buffers the code.
--
Sander
We get to pick tools and equipment that suit the job. We spend nearly all our
time programming ART's computer's. (~P.J.Plauger: Programming on Purpose III)