MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _directory_size_bytes

Function _directory_size_bytes

deployments/desktop/shared/agents.py:426–440  ·  view source on GitHub ↗
(path: Path, max_files: int = 5000)

Source from the content-addressed store, hash-verified

424 return str(resolved)
425
426
427def _directory_size_bytes(path: Path, max_files: int = 5000) -> int:
428 if not path.exists() or not path.is_dir():
429 return 0
430 total = 0
431 count = 0
432 for item in path.rglob("*"):
433 if count >= max_files:
434 break
435 try:
436 if item.is_file():
437 total += item.stat().st_size
438 count += 1
439 except OSError:
440 continue
441 return total
442
443

Callers 1

_storage_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected