stack-like file object

Serge Orlov sombDELETE at pobox.ru
Mon Jan 19 16:38:51 EST 2004


"Rodrigo Benenson" <rodrigob at elo.utfsm.cl> wrote in message news:400be8f3_2 at nova.entelchile.net...
> Hi,
> I need to implement a stack on a file.
> The idea is to have a big list, and put part of his head on the disk. The
> model of access to the file is like a stack (read in order only the tail,
> write only at the tail).
Why don't you use a collection of file organized as stack in one directory
or in many directories if your underlying file system cannot effectively
support many files in one directory. If your pickles are small (much less
than block size of the file system) you can keep several of them in one
file about the size of the block size. Since the files will be small you can
simply rewrite them competely each time you need change them.

-- Serge.





More information about the Python-list mailing list