> for root, dirs, files in os.walk(top): > for name in dirs: > print name > for name in files: This code looks suspicious. At this point, when we say "name", what do we expect to get here? Do you mean the directory name, or the file name? It can't be both! *grin*