lib.FileContext.put(): Add parameter "atomic"

Add the parameter "atomic" to put() / _put(). If instructs the
implementation to take extra precautions to make sure the operation
either succeeds or fails entirely, i.e. doesn't leave a broken target
file behind.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 11:29:36 +02:00
commit 94eee5c4bb
3 changed files with 16 additions and 26 deletions

View file

@ -44,17 +44,3 @@ class Curl(Base):
path = '/' + path
cmd.append(self.__base_url + path)
return await self.__ec.run(cmd, throw=throw, verbose=verbose)
async def _put(
self,
content: bytes,
path: str,
wd: str|None,
throw: bool,
verbose: bool|None,
title: str,
owner: str|None,
group: str|None,
mode: str|None,
) -> Result:
raise NotImplementedError()