Antoine Pitrou wrote: > Steven D'Aprano <steve <at> pearwood.info> writes: >> It depends on what you mean by "temporary". >> >> Applications like OpenOffice can sometimes recover from an application >> crash or even a systems crash and give you the opportunity to restore >> the temporary files that were left lying around. > > For such files, you want deterministic naming in order to find them again, so > you won't use the tempfile module... > 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. -Toshio -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP digital signature URL: <http://mail.python.org/pipermail/python-dev/attachments/20090312/6ed3e6e4/attachment.pgp>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4