Quote:
How to give multiple path names as second argument in rename() to rename the files.
Short answer: You don't.
- You need to recursively scan the tree of directories.
- for each file you want to rename.
- you butcher the file path to extract the actual subdirectory name.
- you assemble the new file name from parts you have.
- and then you do the rename.