lib.FileContext.mkdir(): Add method

Add .mkdir() to the API which should do the expected, and implement it in ExecContext and Local specializations.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-21 21:03:09 +02:00
commit 432830a5c5
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
3 changed files with 13 additions and 0 deletions

View file

@ -160,6 +160,12 @@ class FileContext(abc.ABC):
async def rename(self, src: str, dst: str) -> None:
return await self._rename(src, dst)
async def _mkdir(self, path: str, mode: int) -> None:
raise NotImplementedError(f'{self.log_path}: mkdir({path}) is not implemented')
async def mkdir(self, path: str, mode: int=0o777) -> None:
return await self._mkdir(path, mode)
async def _mktemp(self, tmpl: str, directory: bool) -> None:
raise NotImplementedError(f'{self.log_name}: mktemp("{path}") is not implemented')