Code:
import os import string import sys try: rootdir = sys.argv[1] print "GMod Linux Compatibility Script v0.0.1"; print "You are about to lowercase every directory" print "Press <Enter> to continue"; raw_input(); fileList = [] for root, subFolders, files in os.walk(rootdir): for file in files: fileList.append(os.path.join(root,file)) for rnfile in fileList: try: print "Renaming "+rnfile+" to "+string.lower(rnfile) os.rename(rnfile,string.lower(rnfile)) except: print "Skipping "+rnfile for subFolders in os.walk(rootdir): try: print "Renaming DIR "+subFolders[0]+" to "+string.lower(subFolders[0]) os.rename(subFolders[0],string.lower(subFolders[0])) except: print "Skipping DIR "+subFolders[0] except: print "USAGE: python recrename.py <directory>"
MFG DurtyFree