Fixed problem with directories displaying as files in certain cases.
1 parent d3f76dd commit 961d99dc0e68cdd072c80c6105463946c4c3cb34
@tundra tundra authored on 3 Jul 2001
Showing 1 changed file
View
16
tdir
import sys
 
# Version info
 
VERSION = "$Id: tdir,v 1.57 2001/06/27 20:24:39 tundra Exp $"
VERSION = "$Id: tdir,v 1.58 2001/07/03 20:29:19 tundra Exp $"
 
 
# Booleans
 
def BuildFileList (args, dir, files):
DirList = []
FileList = []
for x in files:
if os.path.isdir(dir + "/" + x) and SHOWDIR:
DirList.append(x)
if (dir[-1] == '/') or (dir[-1] == '\\'): # This if/else sequence necessary because
dirstring = dir + x # 'tdir /' did not properly report directories
else: # on WinDoze32 systems which appears to
dirstring = dir + "/" + x # handle '//' or '\/' in files names very well.
if os.path.isdir(dirstring):
if SHOWDIR:
DirList.append(x)
elif SHOWFILE:
FileList.append(x)
DisplayOutput(dir, DirList, FileList)