1
0
Fork 0

stop execution entirely when atomic_write is unsupported

This commit is contained in:
Nick Sweeting 2020-11-12 14:55:21 -05:00
parent 16ad02d574
commit 4372cb6eec

View file

@ -48,7 +48,8 @@ def atomic_write(path: Union[Path, str], contents: Union[dict, str, bytes], over
except OSError as e: except OSError as e:
print(f"[X] OSError: Failed to write {path} with fcntl.F_FULLFSYNC. ({e})") print(f"[X] OSError: Failed to write {path} with fcntl.F_FULLFSYNC. ({e})")
print(" For data integrity, ArchiveBox requires a filesystem that supports atomic writes.") print(" For data integrity, ArchiveBox requires a filesystem that supports atomic writes.")
print(" Some filesystems and network drives don't implement FSYNC, and require workarounds.") print(" Filesystems and network drives that don't implement FSYNC are incompatible and require workarounds.")
raise SystemExit(1)
os.chmod(path, int(OUTPUT_PERMISSIONS, base=8)) os.chmod(path, int(OUTPUT_PERMISSIONS, base=8))
@enforce_types @enforce_types