update#

用于修改现有文件或目录的磁盘实用程序函数。

函数#

update_file_in_place_as_binary(file_full_path, callback)

rename(source_path, destination_path[, force])

rename_context(source[, destination, dry_run])

用于在存在依赖操作时删除目录(即,您需要确保

backoff_rename(source_path, destination_path[, force])

touch(path[, mkdir, sudo_safe])

属性#

SHEBANG_REGEX#
exception CancelOperation#

Bases: Exception

所有非退出异常的通用基类。

初始化 self。请参阅 help(type(self)) 以获取准确的签名。

update_file_in_place_as_binary(file_full_path, callback)#
rename(source_path, destination_path, force=False)#
rename_context(source: str, destination: str | None = None, dry_run: bool = False)#

用于在存在依赖操作时删除目录(即,您需要确保在删除目录之前其他操作成功)。

示例

with rename_context(directory)

# Do dependent actions here

backoff_rename(source_path, destination_path, force=False)#
touch(path, mkdir=False, sudo_safe=False)#