Question

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?

Was it helpful?

Solution

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 hitting 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 :-(

--- EDIT --- Little something that can help make this trick a tad bit more useful.

you can change the amount of information Eclipse keeps in local history, go to your preferences and then general->Workspace->Local History (Indigo here, may be different on other versions). If you tend to be light headed or burn the midnight oil a bit too much this will help you repair the next day that bug fix you insisted on finishing before going to sleep.

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top