You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					17 lines
				
				457 B
			
		
		
			
		
	
	
					17 lines
				
				457 B
			| 
											2 years ago
										 | 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()
 |