Managing a file buffer

David Johnson dj at david-web.co.uk
Mon Apr 9 08:59:10 EDT 2007


Hi,

I have an application that reads video from a socket and saves it to a file, 
which I then play using GStreamer. The major problem with this approach is 
that the file keeps getting bigger and bigger until the disk is full ;-)

What I'd like to do is have a buffer, say 5MB in size, which I can point 
GStreamer at. So every time I write 60K to the tail of the file, I'd need to 
remove 60K from the head of the file.

How can I achieve this in Python? I looked at truncate() but it seems to do 
the opposite of what I want.

Thanks in advance,
David.

-- 
David Johnson
www.david-web.co.uk



More information about the Python-list mailing list