mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-16 03:45:23 +08:00
version: sunnypilot v2026.002.000 (dev)
date: 2026-06-09T06:39:10
master commit: 01a843e0ac
17 lines
457 B
Python
17 lines
457 B
Python
import os
|
|
import pathlib
|
|
|
|
|
|
def get_consistent_flag(path: str) -> bool:
|
|
consistent_file = pathlib.Path(os.path.join(path, ".overlay_consistent"))
|
|
return consistent_file.is_file()
|
|
|
|
def set_consistent_flag(path: str, consistent: bool) -> None:
|
|
os.sync()
|
|
consistent_file = pathlib.Path(os.path.join(path, ".overlay_consistent"))
|
|
if consistent:
|
|
consistent_file.touch()
|
|
elif not consistent:
|
|
consistent_file.unlink(missing_ok=True)
|
|
os.sync()
|