Discussion:
[fpc-pascal] Custom file drivers
Anton Shepelev
2018-09-30 11:32:39 UTC
Permalink
Hello, all

The documentation on the FILE and TEXT types says
that "nothing prevents the programmer, from writing
a file driver that stores its data for instance in
memory." Is there a more detailed instruction or an
example illustrating how to do it?
--
Please, do not forward replies to my e-mail.

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailma
Marco van de Voort
2018-09-30 11:53:23 UTC
Permalink
Post by Anton Shepelev
The documentation on the FILE and TEXT types says
that "nothing prevents the programmer, from writing
a file driver that stores its data for instance in
memory." Is there a more detailed instruction or an
example illustrating how to do it?
Have a look at unit streamio in package fcl-base (packages/fcl-base/src)
which redirects a textfile to a stream.
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listi
Anton Shepelev
2018-09-30 13:18:51 UTC
Permalink
The documentation on the FILE and TEXT types
says that "nothing prevents the programmer, from
writing a file driver that stores its data for
instance in memory." Is there a more detailed
instruction or an example illustrating how to do
it?
Have a look at unit streamio in package fcl-base
(packages/fcl-base/src) which redirects a textfile
to a stream.
Thanks. That one works with TEXT overriding its
functions openfunc, inoutfunc, flushfunc, and
closefunc, whereas the structure FileRec has none of
them and contains only a THandle member. Does that
mean that one can write a custom driver for TEXT but
not for FILE?
--
Please, do not forward replies to my e-mail.

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailma
Loading...