pyufunc.atomic_save_file#
- pyufunc.atomic_save_file(path, data, *, text_mode=True, overwrite=True)#
Atomically write text or bytes to a file.
- Parameters:
path – Destination file path.
data – Text or bytes to write.
text_mode – If True, open the temporary part file in text mode.
overwrite – If True, overwrite an existing destination.
Note
Source package:
boltons.Source repository: mahmoud/boltons
Source document: https://boltons.readthedocs.io/en/latest/
Source license: BSD License.
Example
>>> atomic_save_file("note.txt", "hello")
- Returns:
The destination path.
- Return type:
Path