datalad_next.shell.operations.posix.delete
- datalad_next.shell.operations.posix.delete(shell: ShellCommandExecutor, files: list[PurePosixPath], *, force: bool = False, check: bool = False) ExecutionResult[source]
Delete files on the connected shell
The requirements for delete are: - The connected shell must be a POSIX shell. -
rmmust be installed in the remote shell.- Parameters:
shell (ShellCommandExecutor) -- The shell from which a file should be downloaded.
files (list[PurePosixPath]) -- The "paths" of the files that should be deleted.
force (bool) -- If
True, enforce removal, if possible. For example, the command could change the permissions of the files to be deleted to ensure their removal.check (bool, optional, default: False) -- If
True, raise aCommandErrorif the remote operation does not exit with a0as return code.
- Raises:
CommandError: -- If the remote operation does not exit with a
0as return code, andcheckisTrue, aCommandErroris raised. It will contain the exit code and the last (up tochunk_size(defined by thechunk_sizekeyword argument toshell())) bytes of stderr output.