From 61700bb985ce2708f489dae6397cf4be3e934d1a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 31 Aug 1992 10:54:54 +0000 Subject: cope with filenames containing spaces --- Tools/scripts/dutree.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/dutree.py b/Tools/scripts/dutree.py index a39f172..d3c905e 100755 --- a/Tools/scripts/dutree.py +++ b/Tools/scripts/dutree.py @@ -7,8 +7,11 @@ def main(): p = os.popen('du ' + string.join(sys.argv[1:]), 'r') total, d = None, {} for line in p.readlines(): - [num, file] = string.split(line) - size = eval(num) + i = 0 + while line[i] in '0123456789': i = i+1 + size = eval(line[:i]) + while line[i] in ' \t': i = i+1 + file = line[i:-1] comps = string.splitfields(file, '/') if comps[0] == '': comps[0] = '/' if comps[len(comps)-1] == '': del comps[len(comps)-1] -- cgit v0.12