Failure to save sample sketch in IDE 2.0.0 Beta 3

Failure to save sample sketch in IDE 2.0.0 Beta 3

I just tried it for the first time, and when I try to save "Blink" in another folder other than "Examples" to the one to edit it, but I can not saved changes: when I open the new Blink edited, the old Blink appears without save.

On the other hand, in another attempt to save "blink" in another folder other than "examples", it has also happened to me that it has created a loop of Blink folders, one inside another, (.../blink/blink/blink/ blink/blink/blink/...), so that it has exceeded the maximum length allowed for the PATH, and that now I can not delete. >:(

I use Windows 7 x64


I cannot follow exactly how you are saving the modified Blink sketch

Can you please describe exactly the steps to recreate the problem ?

Of course, these are the steps:

  1. I opened Arduino IDE 2.0 Beta 3, from the desktop icon, and a empty Sketch File appears whose name is the current date.

  2. I open Blink from File-> Examples-> 01.Basics-> Blink, and said Sketch appears

  3. File-> Save AS, and I keep in Z:\prue_arduino\

  4. I modify the saved file.

  5. Save the file with File-> Save. Here it is supposed to be saved, but it does not.

  6. Press the Close Window button and the message "ARE YOU SURE YOU WANT TO CLOSE THE SKETCH? Any Unsaved Changes Will Not Be Saved. "

  7. I open the file "Z:\prue_arduino\Blink\Blink.ino", but the original Blink file appears.

This error does not happen in a new empty sketch, which is saved correctly. As I say, it only happens with the examples, as far as I have tried.

Regarding the loop of folders generated ...\Blink\Blink\Blink\Blink\Blink\Blink\Blink... It happened to me when trying to open the saved file "Z:\prue_arduino\Blink\Blink.ino" and try to modify it by running the mentioned steps 3 to 7, (using "File-> Save As" and/or "File-> Save").

Having tried these combinations, several times without success, the result is:


For some reason in the code, the program Failure to save, and enters an infinite loop generating folders (with the same name) that contains the sketch.

I hope the description will help you, so you can reproduce the problem and you can fix it soon.


Hi @jmchuenbolon. Thanks for the report and additional information. This is a known bug:

Saving sketches inside sketches has never been supported, but the classic Arduino IDE prevented it with a helpful message, whereas Arduino IDE 2.x has this unfortunate behavior of creating huge number of nested folders (which is the very reason it's not supported).

If you happen to figure out how to delete this Z:\prue_arduino\Blink, would you mind sharing your technique. I happen to have one of these folders as a souvenier of my beta testing work and haven't managed to get rid of it. I'm currently resigned to keeping it around as a pet. I guess I'll have to come up with a fun name for the little rascal.

I had this problem of infinite subfolders this morning. This i really a big and annoying problem to be fixed in priority. To remove them I had to install git bash, and run the command rm -fr folder_path

I wasn't even able to get rid of mine with rm -fr, but I was inspired by your comment to try again, and it worked this time! I remember I had later changed the root folder name to hopefully get the full path under the Windows maximum length, and maybe I never tried rm -fr after that change, or maybe I needed to restart my computer.

Anyway, I agree that fixing it should be a priority and I am confident that it will be fixed very soon.

Not only should the problem of infinite subfolders be solved, but should also be solved the problem of not being able to save examples on another route, such as indicative in my post #0 and #2.

Good news everyone! There is now a fix in progress for the infinite recursive subfolders issue:

If anyone wants to try it out, you can download the "build-artifacts" artifact here:

In this update, the problem indicated in my previous post continue happening:

It is not possible to save and edit an example:

The problem is easy to solve:

When an example is saved, it is saved in read-only mode. To solve it you have to enter the properties of the file and deselect the "Read only" box.

Perhaps, in the next beta, we can save examples "Write Mode" by default.

Perhaps, in the next beta, we can save examples "Write Mode" by default.

I am not sure if that is such a good idea as it would be all too easy to make unintended changes to the examples thus possibly reducing their usefulness

If you want to save your own examples then there is no reason why you cannot create your own examples folder in the sketchbook folder and put them there

The file is saved in another folder, but it is saved as "read only".

This is not happening in the classic version of Arduino IDE.

The file is saved in another folder, but it is saved as "read only".

Thanks for the clarification

Here's the bug report for the original issue of "Save as..." with unsaved changes in the sketch (AKA "dirty") not working:

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