Managing a file buffer

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Mon Apr 9 10:32:56 EDT 2007


David Johnson wrote:

> 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.

A named pipe may be useful to you, depending on your buffering requirements,
and assuming gstreamer can play from one.

e.g. http://www2.linuxjournal.com/article/2156

You can create a named pipe from python.

Jeremy

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list