[Python-Dev] Ext4 data loss

"Martin v. Löwis" martin at v.loewis.de
Thu Mar 12 22:54:04 CET 2009


>>> The sync is necessary to ensure that the data is written to the disk
>>> before the old file overwrites the new filename.
>> You still wouldn't use the tempfile module in that case. Instead, you
>> would create a regular file, with the name base on the name of the
>> important file.
>>
> Uhm... why?

Because it's much easier not to use the tempfile module, than to use it,
and because the main purpose of the tempfile module is irrelevant to
the specific application; the main purpose being the ability to
auto-delete the file when it gets closed.

Regards,
Martin


More information about the Python-Dev mailing list