Need kinda ringbuffer on filesystem
f.geiger at vol.at
Wed Sep 1 08:00:06 CEST 2004
I've a task writing huge amounts of data into a file. I want to display them
in my wxPython GUI now. As there are really many data, loading them into mem
is not an option.
Therefore I'd like to implement something like a ringbuffer but on a file
basis: The task writes the data into the file ringbuffer and the GUI (a
virtual ListCtrl to be concrete) would read from the file ringbuffer. If the
reader is faster than the writer, it doesn't get the data. Well, it's not
exactly like a ringbuffer, because the file is allowed to grow as big as it
It is all because reading and writing at the same time doesn't do it (reader
and writer move the file pointer of each other).
If the ringbuffer idea is not possible to implement, I could think of a
class wrapping a file and some kind of locking. A locked file would create
temp files if written to it. A reader would simply be locked out.
Any other idea?
Many thanks in advance
P.S.: I'm on Windows.
More information about the Python-list