non OO behaviour of file
robin at reportlab.com
Wed Jun 15 20:52:39 CEST 2005
Jp Calderone wrote:
> On Wed, 15 Jun 2005 16:38:32 +0100, Robin Becker <robin at reportlab.com> wrote:
>>Michael Hoffman wrote:
>>>Well, you could use python -u:
>>unfortunately this is in a detached process and I am just reopening stdout
>>as an ordinary file so another process can do tail -F on it. I imagine ther
>>ought to be an os dependant way to set the file as unbuffered, but can't
>>remember/find out what it ought to be.
> open(name, 'w', 0)
> For even more excitment, there's os.open() with the O_DIRECT and O_SYNC flags. You shouldn't need to go to this extreme, though.
> FWIW, I think the behavior of Python wrt file subclasses that override write() is silly, too.
that's the one I was fumbling towards :)
More information about the Python-list