IDE 2.1 won't open my old sketches

Win10 user.

IDE 2.1 won't open my old sketches. Is this because they had spaces in them which were converted to underscores?

This makes no sense. And, definitely is a no-go for me.

I have many many sketches, and I go back to them. For example, we're working on Engineering Summer Camp 2023, and I'm going back to Summer Camp 2022 sketches to adjust them. I'm not gonna copy paste all of this, all of the time.


PS: Arduino Forums should use chatgpt to read my submission and figure out which Category to post it in!

2 Likes

If IDE 1.8.x can open your sketches, why bother with the buggy new version?

Spaces in the file name ?
Then ensure that the name of the containing folder matches any new name of the file.
What is the file extension: .pde or .ino or something else ?

Yes, there is a problem opening files with spaces in the name.
The IDE offers to correct it, if you accepts it creates a copy with the spaces replaced by underscores only in the folder name, but it does not rename the file.
When you want to open the sketch again offers to change the name and again the same...

Same problem when opening .pde files.
The IDE offers to correct it, creates a copy of the folder but does not change the file extension.

I wasn't able to reproduce this. Please provide detailed instructions I can follow to reproduce the bug and I'll investigate further.

Which version of Arduino IDE are you using?

This bug is tracked by the Arduino IDE developers here:

Version 2.1.0, that's what we're talking about, right?

The steps I followed:
I renamed MySketch folder to My Sketch.
I renamed MySketch.ino to My Sketch.ino.
I opened the IDE,
I opened My Sketch from the File/Sketchs menu.
The warning came out and I accepted the name change.
I closed the IDE.
My_Sketch_copy.... folder was generated but the file inside it is My Sketch.ino with no underscore.
I didn't try saving the sketch to see if that would change the name.

Here is what I tried and what I observed:

  1. Create a sketch under your sketchbook folder with this structure:
    My Sketch/
    └── My Sketch.ino
    
  2. Select File > Sketchbook > My Sketch from the Arduino IDE menus.
    The "Invalid sketch name" dialog opens.
  3. Click the "OK" button in the "Invalid sketch name" dialog.
    The "Save sketch folder as..." dialog opens.
  4. Click the "Save" button in the "Save sketch folder as..." dialog.
    The saved sketch opens in the Arduino IDE window.
  5. Examine the structure of the saved sketch.
    The saved sketch has a structure like this:
    My_Sketch_copy_20230610151837/
    └── My_Sketch_copy_20230610151837.ino
    

So everything is working as expected for me. Do you get different results if you perform that procedure?

Which operating system are you using?

But I can open my old sketches easily without any problem with that I have also migrated all the libraries too

Yes, as I said, with the exact same steps, it only renamed the folder but not the .ino file.

I use W10 Home with all updates up to date.

@ptillisch Surprisingly I repeated the steps again and folder and sketch were renamed correctly.
I don't understand what happened in the previous tests. :astonished:

Regards

Thanks for the follow up.

Please do let us know (either here on the forum or by submitting a bug report on the GitHub repository) if you ever find what are the specific conditions under which the sketch file is not renamed to match the new folder name.

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