def disk_usage(self, memoize=True) -> int:
"""Get the total disk usage of the directory and all of its contents.
Args:
memoize: Use cached data if available.
Returns:
The total disk usage of the directory in bytes.
"""
paths = self.scan_paths(memoize=memoize)
total_size = 0
for path, stat in paths.items():
total_size += stat.st_blocks * 512
return total_size
评论列表
文章目录