fix recursion for -t to work on both python 2 and 3
1 parent b0d845a commit 256b6a9f0d3143a3d1cc29951540d7cd556ca6c9
@tundra tundra authored on 17 Jun 2018
Showing 1 changed file
View
6
tdir
import sys
 
# Version info
 
VERSION = "$Id: tdir,v 1.72 2018/05/11 17:42:04 tundra Exp $"
VERSION = "$Id: tdir,v 1.73 2018/06/17 00:00:00 tundra Exp $"
 
 
# Supporting Functions
 
if not os.path.isdir(root):
sys.stdout.write(root + " is not a directory!\n")
sys.exit(2)
if RECURSE:
os.path.walk(root, BuildFileList, None)
for root, dir, files in os.walk(root):
print(root + os.sep)
else:
BuildFileList(None, root, os.listdir(root))