lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

"Jerome Vuarand" <> wrote:
> Thomas Lauer wrote:
> > Wouldn't it be nice if the io module were layered and accepted,
> > within the functional framework already defined, "drivers" which
> > implement the actual I/O? These pluggable drivers would use the
> > infrastructure of the io module, both internally (ie code in
> > liolib.c) and externally. File access via the C runtime (as already
> > implemented in io) would be included by default but this would just
> > be one of many possible drivers which can use the io framework.      
> So far I haven't felt the need to have a 'framework' implemented in io
> library, but next time I add a loader I'll probably refactor that to use
> an array like the one used by require.

When I said "framework" I simply meant the current functions in the io
module. These are currently all hard-coded to use C runtime file io.

What I'd like is to keep that same external calling interface but have
the io functions call pluggable read, write, flush etc. functions
depending on the "filesystem" that was used in the call used
to open the "file".

As it is right now, I am going to duplicate a lot of functionality for
each further "filesystem" that's implemented.

I once did a prototype of such a module but I never got very far in
really integrating it with the io module in a transparent way.

cheers  thomasl