All pastes #254543 Raw Edit

Stuff

public python v1 · immutable
#254543 ·published 2006-11-21 23:46 UTC
rendered paste body
#!/usr/bin/env pythonimport osimport stringdef stuff(root, dir):        if (dir != string.lower(dir)):                os.rename(root+'/'+dir, root+'/'+string.lower(dir))                print "move "+dir+" :"+string.lower(dir)                return 1        else:                return 0def start(treetop):        for root,dirs,files in os.walk(treetop):                for dir in dirs:                        if stuff(root, dir):                                start(treetop)        for root,dirs,files in os.walk(treetop):                for file in files:                        stuff(root, file)start('/tmp/Blah')