Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-09

Custom file drivers

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anton Shepelev

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.

Reply by email

Marco van de Voort
to Anton Shepelev

In our previous episode, Anton Shepelev said:

Show quoted text 5 lines
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.

Reply by email

Anton Shepelev
to Marco van de Voort

Marco van de Voort to Anton Shepelev:

Show quoted text 10 lines
> 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.

Reply by email