Jump to content

RenameAction — Renames a directory or file (preserving the extension)


Recommended Posts

15 hours ago, vitor said:

it acts on the whole path, so it may rename a directory and then can’t get to the files inside

 

Sounds like the real problem is that it works top-down instead of bottom-up.

Link to comment
42 minutes ago, deanishe said:

Sounds like the real problem is that it works top-down instead of bottom-up.


Tried that but the result was the same. Also tried making a loop to rename one result at a time and thought about changing directories before doing the rename. But by that point I would already be losing any benefit of using an external program instead of doing it myself and falling again into the trap of having to test every case.

Link to comment
Posted (edited)
2 hours ago, vitor said:

Also tried making a loop to rename one result at a time and thought about changing directories before doing the rename.

 

IIRC, the way to do it is to recursively collect all the filepaths, sort them (this puts every parent before its children), then process them in reverse order. But yeah, that won't work if your rename program is altering more than the last path component.

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...