We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › [HELP] How to rescue accidentally deleted sketch
Page Index Toggle Pages: 1
[HELP] How to rescue accidentally deleted sketch ? (Read 963 times)
[HELP] How to rescue accidentally deleted sketch ?
Jun 7th, 2007, 6:33pm
 
Hello everybody.
Unfortunately due my incomplete understanding of the 'tab' function in the Processing interface I accidentally deleted a sketch... Is there a way to rescue it?!!?

Please tell me there something somewhere in a memory buffer!

THANKS
Re: [HELP] How to rescue accidentally deleted sket
Reply #1 - Jun 7th, 2007, 6:57pm
 
windows doesnt actually deletes files just rename them
so try not to restart your computer
and install a demo of a file rescue program then recover your files
Re: [HELP] How to rescue accidentally deleted sket
Reply #2 - Jun 8th, 2007, 2:49am
 
uh ?!?
besides im using a mac :-D it's not the OS that deleted the files but Processing itself:
         [tab menu] | delete

ANY HEEEEEELP ?!?!
Re: [HELP] How to rescue accidentally deleted sket
Reply #3 - Jun 8th, 2007, 3:16pm
 
Hi,

Check in your sketch folder if you have exported your sketch to an application.
You Should find the original pde inside one of them (Linux,Mac OS X, Windows)

If not, your only chance is to recover the deleted file with a recovery software (Disk Warrior is great for this).

Re: [HELP] How to rescue accidentally deleted sketch ?
Reply #4 - May 26th, 2009, 4:41pm
 
i have Windows Vista Home Premium. i also didn't understand the way the file tabbing worked. i accidentally deleted on of my sketches from the tab menu. i have not restarted the computer. is there any way i can get it back, PLEASE?!? HELP!
Re: [HELP] How to rescue accidentally deleted sketch ?
Reply #5 - May 26th, 2009, 5:11pm
 
Like he said, some file recovery software probably does the job :
http://tinyurl.com/o7ny67

Re: [HELP] How to rescue accidentally deleted sketch ?
Reply #6 - May 27th, 2009, 1:36am
 
Beside the file recovery (which is better to have installed before deleting!), there might be a trick, if you have run the sketch.

On Windows (at least), Processing creates the Java files to compile and run in a temporary directory. If you can find these files, you will find the source, wrapped in a bit of Java code, but mostly unharmed...

You might need to activate the view of hidden files and folders. I don't know for sure in Windows Vista, but on Windows XP, the temp folder is at:
C:\Documents and Settings\<your login name>\Local Settings\Temp\

There, you will find a number of folders named untitled<bunch of numbers>.tmp (where the sketches you typed and not saved are kept), console<bunch of numbers>.tmp (where System.out and .err are redirected before being displayed in the console pane) and build<bunch of numbers>.tmp (where the .java files are generated and compiled to .class files).

If you find the latest buildnnnnnn.tmp folder, you might find your erased code there.

Now, it is also a good time to think about backups... Smiley
Or even better (and complementary to backups!): get familiar with source control management tools (SCM, aka. VCS, version control system) like Bazaar (my favorite, flexible and easy to use), Mercurial, Git (a bit complex and not yet really Windows friendly) or even Subversion (used by the Processing project, but I prefer now the distributed VCS like the first three).
Someday I will try and make a simple tutorial about Bazaar use for individual programmers: those on their site is very good but perhaps a bit intimidating (covering a lot, including team collaboration, etc.).

For example I experimented fearlessly the Delete menu item (which I never tried) on a little sketch I have.
I did then:
Code:
> bzr ls _QuickExperiments\ArrayListTest\
_QuickExperiments/ArrayListTest/ArrayListTest.pde
(mmm, no longer there)

> bzr status
removed:
_QuickExperiments/ArrayListTest/TypedArrayList.java
(OK, Bazaar found the missing file)

> bzr cat _QuickExperiments/ArrayListTest/TypedArrayList.java > _QuickExperiments/ArrayListTest/TypedArrayList.java
(got it back!)

You can also revert to a previous version if your latest experiment failed, etc.
Page Index Toggle Pages: 1