No project description provided
Project description
openz
A strange file opener.
Usage
from openz import open_for_write, try_rollback
with open_for_write(
path,
text_mode=True,
overwrite=True,
with_atomicwrite=True,
with_lockfile=True,
with_exclusive=False, # unable work with `with_atomicwrite`
with_backup=True
) as fp:
fp.write('content')
Restore data from crash
Make sure set with_backup=True
and backup_for_fault=True
:
with open_for_write(path, with_backup=True, backup_for_fault=True) as fp:
...
Then you can restore it from the backup:
try_rollback(path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openz-0.1.2.tar.gz
(3.2 kB
view hashes)
Built Distribution
openz-0.1.2-py3-none-any.whl
(3.8 kB
view hashes)