On Thu, Feb 4, 2010 at 4:02 PM, Terry Brown <[email protected]> wrote:
> That bites. I've used that pattern without problems, but I guess it always > made me nervous. > > fd,backupName = tempfile.mkstemp(text=False) > os.write(fd, open(fileName, 'rb').read()) > > is... probably not good enough. Inefficient when backupName and fileName are > on the same disk, and bad when fileName is big. Efficiency does not concern me. The new code seems to work fine. The temp file eventually goes away, so wasted space is not a problem. > os.fsync(fd) help at all? Can't really see how, as you can't call it after > .close(). I agree. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
