python-dev
[Prev] Thread [Next] | [Prev] Date [Next]
Re: [Python-Dev] Ext4 data loss Toshio Kuratomi Thu Mar 12 15:01:24 2009
Martin v. Löwis wrote: >> Something that doesn't require deterministicly named tempfiles was Ted >> T'so's explanation linked to earlier. >> >> read data from important file >> modify data >> create tempfile >> write data to tempfile >> *sync tempfile to disk* >> mv tempfile to filename of important file >> >> 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? The requirements are: 1) lifetime of the temporary file is in control of the app 2) filename is available to the app so it can move it after data is written 3) temporary file can be created on the same filesystem as the important file. All of those are doable using the tempfile module. -Toshio
_______________________________________________ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/alexiscircle%40gmail.com
- Re: [Python-Dev] Ext4 data loss, (continued)
- Re: [Python-Dev] Ext4 data loss Antoine Pitrou
- Re: [Python-Dev] Ext4 data loss Greg Ewing
- Re: [Python-Dev] Ext4 data loss Nick Coghlan
- Re: [Python-Dev] Ext4 data loss Antoine Pitrou
- Re: [Python-Dev] Ext4 data loss Nick Coghlan
- Re: [Python-Dev] Ext4 data loss Antoine Pitrou
- Re: [Python-Dev] Ext4 data loss Steven D'Aprano
- Re: [Python-Dev] Ext4 data loss Antoine Pitrou
- Re: [Python-Dev] Ext4 data loss Toshio Kuratomi
- Re: [Python-Dev] Ext4 data loss Martin v. Löwis
- Re: [Python-Dev] Ext4 data loss Toshio Kuratomi <=
- Re: [Python-Dev] Ext4 data loss Martin v. Löwis
- Re: [Python-Dev] Ext4 data loss Toshio Kuratomi
- Re: [Python-Dev] Ext4 data loss Martin v. Löwis
- Re: [Python-Dev] Ext4 data loss Toshio Kuratomi
- Re: [Python-Dev] Ext4 data loss Nick Coghlan
- Re: [Python-Dev] Ext4 data loss Mikko Ohtamaa
- Re: [Python-Dev] Ext4 data loss Zvezdan Petkovic
- Re: [Python-Dev] Ext4 data loss Martin v. Löwis
- Re: [Python-Dev] Ext4 data loss Zvezdan Petkovic
- Re: [Python-Dev] Ext4 data loss Andrew McNabb