I feel the Arduino IDE like a liar, It's interface alway show your new-version code ,and write new-version code to board, but don't save a bit in hard drive. If u close it, there is no warning to tell your save your work. It is a so easy to add a function to remind users save work. I think I'm not the only one who has this trouble.
I save often. It is a habit you need to get into.
I agree that it should warn you when closing the program if you have not saved since you've made a change since the last save. But working for 3 hours without saving once, you could have lost everything to a power glitch or computer crash.
if you use windows, look in your temp folder, a copy of your code is most probably there ( mine stay after the IDE closes ). It will just have a few additions by the IDE.
My temp folder Arduino uses is: C:\Users\Chris\AppData\Local\Temp\ sort your temp folder by date and find the latest folder that is named like: build1341542768814376187.tmp you should find a file named similar to: sketch_jan21a.cpp, rename yours to .ino and you are back in business.
This of course will only work if you have compiled the sketch ( verified or uploaded )
My version of the IDE (1.0.5 on Windows) warns if you try to close the IDE without saving What version/OS are you using ?
mine too, versions 1.0.5 & 1.5.2
HI, I never rely on the app asking if you want to save on exit. As I write my sketch I save regularly and change names as I advance, ie.
sketch1_0 sketch1_1 sketch1_2 that way if anything crashes I have at least a recent copy to go back to.
Three hours programming phew....... =(
Tom..... :) (Save often...)
I hit ^S all the time, no matter what program I’m using. I also run FileHamster in the background, that creates an archive every time you save a file it’s monitoring.
While I admit that not warning the user of changes is very bad practice, so is working tor 3 hours without saving, your computer could have crashed at any time. Lesson learned eh?
I overwrote 6 hours worth of program with the "build" file that would have compiled it, having impatiently answered the "do you really want to do this" confirmation without actually READING it till it was too late...
someguy163: I feel the Arduino IDE like a liar, It's interface alway show your new-version code ,and write new-version code to board, but don't save a bit in hard drive. If u close it, there is no warning to tell your save your work. It is a so easy to add a function to remind users save work. I think I'm not the only one who has this trouble.
I use version 1.05 It asks me politely if I want to save before closing.
You should look at the bright side of it.
A lot of people could have been telling you to "save your work with regular intervals" for far longer than three hours. And you probably would not do it anyway.
Now you have learned something, and you will remember it. Learning something that will do you good in the years to come, is a very valuable thing.
If you have a new version of the IDE, it probably asked you, and then you have also learned to be aware of, what your software is trying to tell you.
...... And should you learn to spell "you" with three letters (YOU), you will have learned three things today, and you have achieved something marvelous!
(And if you are using an old version of the IDE, "It is not that bad to keep my software up to date" is the fourth valuable lesson)
Thank you pYro_65 your advice is the one that helped me to recover my work.
I have to complete the information with the fact that by using Sketch - Add File - whatever.ino to replace whatevet.ino Tab allready present in the main sketch and not saving whatever.ino before compiling, Arduino IDE will loose whatever.ino when closed even if while in use, compilation process will work normally ... NOT GOOD AT ALL
The only way to recover is for the user to find his last C:\Users\Victor_Hantelmann\AppData\Local\Temp\build2045108113295406279.tmp and look in main_project.cpp file for the lost data.
Thank you pYro_65 for sharing.
victorhantelmann: Thank you pYro_65 for sharing.
No worries, remember to back them up once recovered (to a location the IDE does not touch).
From loosing many essays while studying, I picked up the use of Ctrl+S. So much so, its has become a subconscious habit. Even sometimes while posting a thread on the forums, I find myself trying to save it.