If I want to overwrite existing backup.ino file with an upgraded orig.ino
it says backup.ino exists you want to overwrite? I said yes. it does without error, but it does not do it.
Hi @antal_peter . The Arduino IDE developers are tracking this bug here:
opened 04:05AM - 14 Mar 21 UTC
topic: code
type: imperfection
criticality: medium
### Describe the problem
When an existing sketch file is selected during a "*… *Save as..**" operation, the IDE asks the user to confirm the overwrite, but does not overwrite regardless of the user's choice.
### To reproduce
1. Select **File > New** from the Arduino IDE menus.
1. Select **File > Save as...** from the Arduino IDE menus.
1. Save the sketch to a convenient location.
I'll refer to this sketch as "**Sketch1**", but the name doesn't matter.
1. Select **File > New** from the Arduino IDE menus.
1. Modify the text in the sketch file so it's different from the "**Sketch1**" sketch.
1. Select **File > Save as...** from the Arduino IDE menus.
1. Open the folder containing "**Sketch1**".
1. Click on `Sketch1.ino`
1. Click the "Save" button.
A dialog opens:
> ### Confirm Save As
> Sketch1.ino already exists.
> Do you want to replace it?

1. Click the <kbd>Yes</kbd> button, indicating you want to replace `Sketch1.ino`.
1. Open `Sketch1.ino` in a text editor.
🐛 `Sketch1.ino` contains the original text it was first saved with.
### Expected behavior
When I confirm I want to overwrite the sketch, it should be overwritten.
### Arduino IDE version
#### Original report
2.0.0-beta.3-snapshot.520b3a8
#### Last verified with
9a6a457bc44fb16f646b9e61a9e8b336b3666412
### Operating system
Windows
### Operating system version
11
### Additional context
This also occurs when doing a "**Save As...**" with "**Sketch1**". But that requires having "**Auto Save**" disabled and risks being mistaken for https://github.com/arduino/arduino-ide/issues/65.
For this reason, I chose to use two sketches in the demo, which works regardless of the "**Auto Save**" setting.
---
This works as expected when using Arduino IDE 1.x.
---
I also tested this with the build from https://github.com/arduino/arduino-ide/pull/211 with the same results I described above.
#### Additional reports
- https://forum.arduino.cc/t/ide2-2-1-does-not-overwrite-existing-backup-file/1172413
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject: