carrot/system/updated/common.py
Vehicle Researcher d64fb1838d openpilot v0.9.7 release
date: 2024-06-11T01:36:39
master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
2024-06-11 16:32:27 -07:00

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()