views:

408

answers:

3

I'm using eclipse, when i close eclipse, it ask me save a file, I press yes and eclipse shuts down. When I open my computer I see that the drive only has 3 bytes left, and I get a bad feeling. I go to my file and oh my god, it's totally blank, size is 0 byte! :(

I need that file back, can a free recovery program can work on this case?

+2  A: 

First, turn off the computer. Every second that it is on and being used at this point reduces the chance you'll recover your file.

thedz
+3  A: 

Sometimes Eclipse keeps the changes it made to the files you edit. Does not always work but it's worth a try :

  • Find you file in your (package, project, navigator) explorer.
  • Right click on your file and look for the menus to compare... (I recommend Compare though in your case it will not matter since the file is now empty)
  • Choose Local History... from the sub menu

If you are lucky and had been using Eclipse to edit the file you should find a few entries there. Look them up, chances are you will find the content.

This has helped me countless times and saved my ass on many occasions. However, every times I resort to it I always feel like bagning my head with a baseball bat for not commiting changes to the source control system earlier.

good luck, if that does not work I fear the SO will not be of much help to you :-(

Newtopian
cookie for u http://thehealthblogger.com/wp-content/uploads/2008/07/cookie.jpg :p, i did your way but it said history not found for this file, after that i did myself text search in .metadata\.plugins\org.eclipse.core.resources\.history and got it now, thankyou thankyou thankyou.
StoneHeart
glad it all worked out for you ... and thanks for the cookie :-) This is one of the nice things about Eclipse, a lot happen in the background for you which you can use later for other purposes if needed.
Newtopian
+2  A: 

If you know some phrase or uncommon word from your file, you can search the raw sectors of the hard drive for pieces of text. This will turn up the text anywhere it might have been written: as paged out virtual memory, as a stil-existant file (temp file or saved file), or as temporary or saved file that was deleted and the space has not yet been rewritten.

But it will be slow. And if the file was never written to disk, it will yield nothing. And what it yields may be fragmented or incomplete.

Boot a Knoppix CD and start grepping! Knoppix is a linux installation that runs from CD, without writing to your hard drive.

If you have SCSI or SATA disks, you need to use /dev/sda instead of /dev/hda

The other answer is correct, every moment that OS continues running decreases your recovery chances. pull the power and use another computer to prepare the knoppix CD.

Joe Koberg