Show More
@@ -237,9 +237,9 b" def atomic_writing(path, text=True, encoding='utf-8', **kwargs):" | |||||
237 | """Context manager to write to a file only if the entire write is successful. |
|
237 | """Context manager to write to a file only if the entire write is successful. | |
238 |
|
238 | |||
239 | This works by creating a temporary file in the same directory, and renaming |
|
239 | This works by creating a temporary file in the same directory, and renaming | |
240 | it over the old file if the context is exited without an error. If the |
|
240 | it over the old file if the context is exited without an error. If other | |
241 | target file is a symlink or a hardlink, this will not be preserved: it will |
|
241 | file names are hard linked to the target file, this relationship will not be | |
242 | be replaced by a new regular file. |
|
242 | preserved. | |
243 |
|
243 | |||
244 | On Windows, there is a small chink in the atomicity: the target file is |
|
244 | On Windows, there is a small chink in the atomicity: the target file is | |
245 | deleted before renaming the temporary file over it. This appears to be |
|
245 | deleted before renaming the temporary file over it. This appears to be |
General Comments 0
You need to be logged in to leave comments.
Login now