diff --git a/ocopy/utils.py b/ocopy/utils.py index 79381d1..1dfcfa3 100644 --- a/ocopy/utils.py +++ b/ocopy/utils.py @@ -15,11 +15,9 @@ def wrapper(*args, **kwargs): def folder_size(path): total = 0 - for entry in os.scandir(path): + for entry in Path(path).glob("**/*"): if entry.is_file(): total += entry.stat().st_size - elif entry.is_dir(): - total += folder_size(entry.path) return total