Is Rename tool broken?

I've only just found this feature, which would be very handy - but it doesn't appear to work. Gives message "Failed to rename sketch folder", and doesn't change anything.


Up until now, if I wanted to change a name, I'd save with that new name (which places it in a folder of the same name) and then have the chore of deleting the old one. This tool would be much easier. Do others get same problem with it please?

Are you trying to rename a file in a tab, which is what that dialogue you posted does, or rename the entire sketch ?

Both give the same error.

I just happened to be exploring the other feature that's new to me, namely organising a sketch into tabs, when I took the screenshot. Should have avoided the ambiguity :wink:

Is there any difference? If you rename the first tab the sketch itself ( including the sketch directory ) is renamed. At least that's how my IDE ( 1.8.15 ) does it.

I think I've discovered the cause. The IDE apparently assumes that the sketch's folder is also open. That's often the case, but certainly not always for me, especially if I'm working with several sketches.

I rename my tabs all the time. Never a conflict. You can also close the IDE and rename the file in File Explorer.

Problem still occurs today, even with folder open, so I'm baffled.

Same result with any file tried now, e.g. test.ino

No one else here get a renaming problem with this tool?

(I do know how to use File Explorer.)

I wonder if the fact that the file is in a Dropbox folder is causing the problem ? Please try the rename in another folder

We're thinking along the same lines. It occurred to me after posting that it might be a path length issue. The one that failed was 118 characters long. I copied it to a higher folder (still in my Dropbox parent folder) and it renamed OK.

I'll report back if/when I find the critical max path length.

Bizarre behaviour. Couldn't reproduce that last test. Or several others, including outside the Dropbox folder. For example I saved a new file in
and successfully changed it to

But then I manually changed that to
I then opened it and tried changing it with Rename to TestRename2ToANewName
but that failed, with the error.

Tried that again, renaming to TestRename3, and that failed too.
Tried a minor edit to code and saved file before the attemp to rename, but that failed too.

Same with filenames as simple as A.ino. Only seem to succeed when renaming a new file for the first time.

EDIT: This may be relevant.

After spending couple of hours I have to drop it for now.

You can't change the main tab name (the left-most tab) in the tab rename dialog. That can only be done in Explorer or by doing a save-as of the sketch.

1 Like

Thanks Steve, understood.

I've abandoned use of that Rename feature and will resume any renaming from the parent folder in File Explorer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.