Overwriting a ino file with "Save as" deletes all data in folder
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I opened a new project in Arduino IDE 1.8.13 on Arch linux, wrote some code in it and saved it to the default location, ending up with a project called something like sketch_nov06b.ino.
I wanted to overwrite an old project I had, as this code did the same job but better. I clicked "File -> Save As...", and saved it as a dot ino file that already existed. I was prompted that this would delete the old dot ino file, which I was ok with. In addition to deleting the dot ino file, it deleted the whole folder, with all the data in it, and created a new folder with the same name containing nothing but the new ino file.
# Steps to reproduce
Have a folder with a sketch and some important data.
$ pwd
/home/haavagj/git/test_project
$ ls
important_data.txt important_data.txt~ test_project.ino test_project.ino~
$ cat test_project.ino
void setup() {
// put your setup code here, to run once:
unimportand_code();
}
void loop() {
// put your main code here, to run repeatedly:
more_unimportant_code();
}
Overwrite test_project.ino with Arduino IDE 1.8.13 on Arch linux and lose important data.
$ ls
ls: reading directory '.': No such file or directory
$ pwd
/home/haavagj/git/test_project
$ cd ../test_project
$ ls
test_project.ino
$ cat test_project.ino
void setup() {
// put your setup code here, to run once:
improved_setup();
}
void loop() {
// put your main code here, to run repeatedly:
improved_loop();
}
Contributor guide
Research direction
Start with the File → Save As flow in Arduino IDE 1.8.13 and reproduce the overwrite on Arch Linux using the folder layout and commands shown. Done means replacing the existing .ino file without deleting the containing folder or other files such as important_data.txt and its backup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arch-linux, java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100