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.
Please login to continue.