I woke up this morning and decided I wanted to continue working on my code for a mini 'phone' project I'm working on, and after I opened the ide I saw all the code I've been working on (about 500 lines) is gone!
I have no clue what to do, and I am really angry and sad.
I go to the folder for the ide and it says 14kb, tried opening it in notepad, all empty.
For information, the night before I had decided to finish up on a specific part, save and close the ide, about half an hour later I do a windows update and shut down.
Now I am here.
For reference I've been coding in arduino for about 2 years and never had this problem previously and can't find much on how to fix.
Sounds like a Window's problem, do a search for the filename.
Do you do backups? If not take this as a warning that you must do backups, all hard drives fail eventually, and when they do you lose everything if it's not backed up.
I'm not good enough with Windows to advise you further I'm afraid, the only thing I can suggest is what I already have: search for the file in Windows. If it's not there then I know of no way to retrieve it, sorry. Maybe someone else does.
Thx for the help and I have done, it says the file size is 14 kb and that it was last modified on the 16th I have actually been working on another un related project for backing up files n things around the house, kinda ironic
the sketch is completed corrupted. it turned into a binary file containing all NULs when viewed with editor.
A sketch that has been corrupted in this way could appear empty, yet have a size larger than could be expected for a truly empty file.
The IDE does store a copy of the sketch in a temporary build folder under this path:
C:\Users\<user name>\AppData\Local\Temp
AppData is a hidden folder by default, so you need to configure your file browser to show hidden folders before it will be visible.
Unfortunately, the IDE does clean up the temporary build folder on exit, so it is not a reliable way to recover sketches. It is worth a check though because if something happened like the IDE crashed or your computer lost power then the clean up would not have occurred and the build folder would have been left behind.
The sketch saved to the build folder has been through sketch preprocessing which saves it to a file named after the sketch name, with a .ino.cpp file extension. Even though that preprocessed code will not be identical to your original sketch, the changes are very minimal so it would be simple to restore the original sketch from the preprocessed file contents.
I can't seem to find any folders with.ino .cpp there is only random jiberish.tmp files on the date needed. Thx for the help, I'll have a look at that post too.
This worked for me. Thank you so much! It had a file from a few weeks ago but it was better than starting from scratch. You are a real lifesaver. Thank you.