Add size.py.
This commit is contained in:
parent
3e5e421484
commit
5806930198
1 changed files with 17 additions and 0 deletions
17
size.py
Normal file
17
size.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import sys
|
||||
|
||||
from voussoirkit import bytestring
|
||||
from voussoirkit import spinal
|
||||
from voussoirkit import pathclass
|
||||
|
||||
paths = sys.argv[1:]
|
||||
paths = [pathclass.Path(p) for p in paths]
|
||||
|
||||
total = 0
|
||||
for path in paths:
|
||||
if path.is_file:
|
||||
total += path.size
|
||||
elif path.is_dir:
|
||||
total += spinal.get_dir_size(path)
|
||||
|
||||
print(total)
|
Loading…
Reference in a new issue