Message162133
os.path.isfile doesn't reckognize a .picasa.ini file as a file
and os.path.isdir doesn't reckognize a directory as a directory
code:
def traverse (targetDir):
currentDir = targetDir
dirs = os.listdir(targetDir)
# dirs = [x for x in os.listdir('.') if x.endswith('.JPG')]
for entry in dirs:
if os.path.isdir(entry):
print("Traversing " + entry)
traverse(entry)
else:
print("Not dir: " + entry)
if os.path.isfile(entry):
print("Processing " + " " + currentDir + " " + entry)
else:
print("Not file: " + entry)
print("\n")
return True
The test directory contains jpg files and a folder with some other jpgs and a subfolder containing jpgs |
|
Date |
User |
Action |
Args |
2012-06-02 13:06:53 | javahaxxor | set | recipients:
+ javahaxxor, ronaldoussoren |
2012-06-02 13:06:53 | javahaxxor | set | messageid: <1338642413.05.0.366116403314.issue14985@psf.upfronthosting.co.za> |
2012-06-02 13:06:52 | javahaxxor | link | issue14985 messages |
2012-06-02 13:06:52 | javahaxxor | create | |
|