mirror of https://github.com/mahmoud/boltons.git
clarify atomic file rationale
This commit is contained in:
parent
14bfebd6f9
commit
8640462ca3
|
@ -21,9 +21,14 @@ Atomic File Saving
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Ideally, the road to success should never put current progress at
|
Ideally, the road to success should never put current progress at
|
||||||
risk. That's why overwriting a file should only happen after the task
|
risk. And that's exactly why :func:`atomic_save` and
|
||||||
at hand has completed. And that's exactly what :func:`atomic_save` and
|
:class:`AtomicSaver` exist.
|
||||||
:class:`AtomicSaver` do.
|
|
||||||
|
Using the same API as a writable file, all output is saved to a
|
||||||
|
temporary file, and when the file is closed, the old file is replaced
|
||||||
|
by the new file in a single system call, portable across all major
|
||||||
|
operating systems. No more partially-written or partially-overwritten
|
||||||
|
files.
|
||||||
|
|
||||||
.. autofunction:: boltons.fileutils.atomic_save
|
.. autofunction:: boltons.fileutils.atomic_save
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue