And again.
-- Forwarded message --
Date: Thu, 23 Dec 2004 14:55:15 -0800 (PST)
From: Marilyn Davis <[EMAIL PROTECTED]>
To: Lee Harr <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Re: tempfile
os.lseek! How did I not find that.
Thank you. I'm set.
Marilyn
On Fri,
fileObj=...
fileObj.seek()? Is what I use, although that's for specific byte
positions I believe.
On Fri, 24 Dec 2004 03:09:31 +0430, Lee Harr <[EMAIL PROTECTED]> wrote:
> >I'm using tempfile. The doc says it is opened 'w+b' so that it can be
> >read and written without closing and reopening.
>
I'm using tempfile. The doc says it is opened 'w+b' so that it can be
read and written without closing and reopening.
But, for the life of me, I can't find any way to rewind it so I can
read what I wrote.
import tempfile
import os
fd, name = tempfile.mkstemp()
os.write(fd, 'foo')
3
os.lseek(fd, 0