os.renames()

os.renames(old, new)

Recursive directory or file renaming function. Works like rename(), except creation of any intermediate directories needed to make the new pathname good is attempted first. After the rename, directories corresponding to rightmost path segments of the old name will be pruned away using removedirs().

Note

This function can fail with the new directory structure made if you lack permissions needed to remove the leaf directory or file.

doc_python
2016-10-07 17:39:33
Comments
Leave a Comment

Please login to continue.