Loading...
Logo
Processing Forum

.pde file empty after JRE crash

in General Discussion  •  Other  •  3 years ago  
Hello to all,
not sure where to post this so here it goes:

I had a very unpleasant experience when the JRE unexpectedly crashed and I was left with my working .PDE sketch file empty. Completely empty i.e. 0 KB  (needless to mention I had already saved the sketch numerous times)

Anyone had a similar situation? 
I am using Ubuntu Linux 10.04 with  JRE version: 6.0_20-b02 (Java HotSpot client VM 16.3-b01) and Processing 1.2.1

Cheers
Chris




Replies(5)

I hadn't this experience, but as a general advice to everybody:
- Do backups!
- Use a VCS. For individual programmers, I recommend DVCSes, like Bazaar (my favorite), Mercurial or Git, but if you go for SVN, why not.
It might seem overkill, but if you do any serious programming, ie. more than a dozen of lines per week, go for it! It is well worth the time spent in learning it.

Of course, in the heat of the coding, we might forget to interrupt and do a commit, so it might have not helped you in your case (if it was the coding of the moment), but in many other cases, it will save your day.
reading something like this, i can only say it again. i would love to see the feature of an autosaved backup file.
we are just talking about some lines of code here in most of the cases. so doing an autosave backup every x seconds/minutes, shouldnt be a big problem. So you could always find a backup of the file you are working in the processing folder named sketchname.pde.backup for example in case your PDE crashes.
would be a nice feature for future processing versions.
@phi.lho: Thanks for the recommendations, that would be a very good idea (mostly if your code is large). But then again it's just like you said: "  in the heat of the coding". Not to mention that s ometimes you may start coding something completely new with the intention to play/learn  rather to actually finish a project and you end up with a very useful piece of code (that was my case). Oh well.
I agree with @cedrickiefer. An autosave feature would be extremely time-saving.



Yes, it was more an opportunity to give the advice than to help you, alas.
Sometime, often for this forum, I code something not trivial without even saving the file: the power of Processing, and the loss if something bad happens...
I like the idea given by Cedric...

Come to think of it, actually you might have a trace of the code: Processing saves the file in the temp dir of your system in order to do the pre-processing and the Java compilation. It might be too late (or not, if you don't clean up your tmp often) but you can check this folder to see if your sketch isn't there.
And a good advice that is. Yes my first reaction was to look at the /tmp folder, where there was only an empty "sketch_xxx.pde" file (and the "find" command came up with nothing as well). Anyway, thanks again for your recommendations.