添加 otg 文件夹创建判断,避免文件夹存在导致程序退出

This commit is contained in:
mofeng-git 2025-03-11 12:52:19 +00:00
parent a59fe84e26
commit 7116da2511

View File

@ -48,7 +48,8 @@ from .hid.mouse import make_mouse_hid
# =====
def _mkdir(path: str) -> None:
get_logger().info("MKDIR --- %s", path)
os.mkdir(path)
if not os.path.isdir(path):
os.makedirs(path, exist_ok=True)
def _chown(path: str, user: str, optional: bool=False) -> None: