I pinned this issue down finally, it caused me grief in RC3 also.
If you do a "save as" to a different EXISTING .ino filename (by navigating to and selecting it in the windows file dialog) you get the expected "file already exists" warning. So far so good.
But when you click on yes, what it actually saves to is the file you are working on. The filename that was clicked on remains unchanged.
If you do a Save As to your current file, you get the file exists warning but it does update the working file.
I hate to talk to myself, but I am using RC5, and previously had this problem unidentified in RC3 and RC4.
What operating system and release number?
Windows 10, 21H1.
Or maybe you meant Arduino IDE 2.0, RC5 (just downloaded it tonight).
Hi @weshowe . Thanks for your report.
This bug is being tracked by the Arduino IDE developers here:
opened 04:05AM - 14 Mar 21 UTC
topic: code
type: imperfection
criticality: medium
## Describe the bug
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.
## Screenshots

## Desktop
### Original report
- OS: Windows 10
- Version: 2.0.0-beta.3-snapshot.520b3a8
Date: 2021-03-12T13:42:48.605Z
CLI Version: 0.16.1 alpha [76f55490]
### Last verified with
- OS: Windows 10
- Version: 2.0.0-rc5
Date: 2022-03-10T11:09:10.332Z
CLI Version: 0.21.0 [10107d24]
## 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 the classic Arduino IDE.
---
I also tested this with the build from https://github.com/arduino/arduino-ide/pull/211 with the same results I described above.
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
TY. Now that I understand this, I can workaround with the file explorer until you experts get it figured out.
system
Closed
September 7, 2022, 5:01am
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.