Skip to content

Overwriting a ino file with "Save as" deletes all data in folder #10931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hgjersdal opened this issue Nov 6, 2020 · 1 comment
Open

Overwriting a ino file with "Save as" deletes all data in folder #10931

hgjersdal opened this issue Nov 6, 2020 · 1 comment
Labels
Component: IDE user interface The Arduino IDE's user interface Type: Bug

Comments

@hgjersdal
Copy link

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();
}
@per1234
Copy link
Collaborator

per1234 commented Nov 6, 2020

Related to the discussion in #10879 regarding the IDE's save/save as UI not clearly communicating to the user that the sketch the the complete folder, not just the .ino file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants