Help! Recover Eclipse file [closed] - eclipse

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this 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?

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.

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.
get knoppix: http://www.kernel.org/pub/dist/knoppix/KNOPPIX_V6.0.1CD-2009-02-08-EN.iso)
Boot it. Start a terminal. Search the hard drive:
$ sudo grep "Four score and seven years" /dev/hda
If it turns up anything, copy and paste to a text editor, and save to usb stick or send it to yourself via web-based email.
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.

Related

NetBeams checking for external changes - suspended bug out whole IDE [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Like 3 days ago, my netbeams started to sometimes bug out. It is either when i am just starting netbeans, and "Background scanning of objects" get stuck at any percent (it varies), o ir if loads properly, after some time, "checking for external changes - suspended" will show up and then the problems starts: netbeans does not compile errors, does not open class or start a code (it will show as "lengthy operation in progress", after some time, output will show that no compiler was found, if clicked on class - "go to source or something like that"). After restarting netbeans, if it loads properly, it will run smoothly until same thing happens. Also, i saw that even when i close netbeans, there is a java process running in a task manager(uses like 30% of my cpu).
I tried reinstalling, deleting everything by hand and then reinstalling, cleaning cache... Nothing helps. Also it happened at the same day on my 2 computers.
I think it has something to do with "checking for external changes -suspended", because when a bug starts, this process will always appear. Even if i close it manualy (just click X), it will start again after few secs. I tried to disable automatic scanning of procceses in options it doesnt help, and acts the same (just checking for external changes suspended doesnt appear anymore).
It is not consistent, but makes me unable to properly work. Maybe anyone has any ideas what should i do?
Yes, you should delete NetBeans cache! The path of the cache directory is listed in the About window (menu Help/About). Close NetBeans, then delete the directory. NetBeans will rebuild its cache when it starts up.
I was also able to reduce the likelihood of this occurring by disabling "auto-scanning of sources".
Once disabled, you can trigger this manually by right clicking the project folder and choosing "Refresh Folder".

How to overcome gzip/Mavericks incompatibility? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
So I recently changed jobs and I brought a bunch of files with me off my OS X 10.7 system. I had way too many files than could fit on the external drive I had, so I had tried dragging select files onto the drive, which gave me eventual repeated errors, so instead I used:
tar -zcvf whatever.tar.gz my_files
and then dragged the gzipped tarball onto the drive and that worked just fine. Now however, on my new Mavericks 10.9 system, I just tried to open a rich text file (that I'd created in Text Edit on 10.7) and I get the error:
'The document "_lab_notebook_2.rtf" could not be opened.'
I called Apple about this and they claimed that gzip was adding "the command line" to the metadata of the file (I assume the rich text file - though I could be wrong) and that metadata chunk is incompatible with Text Edit in Mavericks. They said that they have a request in with the gzip developers to address this issue (by stripping out the added metadata at some point along the way). Eventually, they say once that is updated, it will be in a new system update.
In the meantime, I'm stuck with a file that Text Edit can't open. I can open the file in other text editors, but I really would rather use Apple's Text Edit, hence this post. I tried opening a copy of the file with Rezilla and I can see the metadata in coded form, but nothing's jumping out at me as the offending data. I even tried removing each resource 1 by 1 and trying to open the file after each removal, but it still would not open.
Does anyone have any hints as to how to strip out whatever it is that gzip added? Am I even working from the correct starting point? They said that the data was added during the zip-up of the file, and I no longer have access to the original. Should I be working with the .tar.gz file or the .rtf file that was contained there-in?
Thanks,
Rob
The file you are trying to open, _lab_notebook_2.rtf might not be the file. (Are you sure it doesn't have a dot before the underscore, i.e. ._lab_notebook_2.rtf?) It may be the resource fork of the actual file, where the actual file would be named lab_notebook_2.rtf.
I don't know who you talked to at Apple, but gzip doesn't add anything to anything. It is simply a lossless compression and decompression utility. They certainly haven't contacted me about it (I am one of the gzip developers). Please look up my contact information, e.g on zlib.net, and copy that email to me. Thanks.
tar on the other hand may not be preserving all of the information that was on the original file system, or storing resource forks as ._ files, depending on what you asked it to do. It would have been better if you had used the Finder File:Compress operation, which preserves all of that information. (Or on the command line, the ditto utility with the options noted in its man page to duplicate what Finder does.)

Recover lost Java source code due to previous abnormal exit of eclipse [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My java code which almost spanned 3000 lines was open on Eclipse code window as I was working on that. Suddenly my PC froze and I had to restart it. Later when I opened eclipse it threw some error saying some org.eclipse... file was corrupt, dint bother to write it down, my fault :(
But later it showed "could not read metadata for workspace dir.metadata.plugins\org.eclipse.core.resources.root.indexes\properties.index" in my java code file.
I restarted eclipse to get rid of the error, but the result was disastrous; the java code file was empty. My worry is, after my last backup, I had done a lot of changes to it here n there.
Finally I could figure it out. jst need to compare with local history :P
Am not sure if this will work but you can give these 2 methods a try:
Right click file-->Team-->Show local history (Try to look for the file in "history view")
If this fails,try
2. Manually go to "Eclipse workspace.metadata.plugins\org.eclipse.core.resources.history"
You can find a list of folders named with few letters, use the “Date Modified” column and open the latest of those folders to get the recent files you were working on.
In that folder, you can find some files with unusual naming, open the files with some text editor to find the file you are searching for, if possible try to match the file size.
Let me know if this helps.
:)
Welcome to Stack Overflow, Johny
I think you may find your code in your 'Local History'
Refer :
How to recover Java file from Eclipse Project that damaged by getting power off?
eclipse recovering from crash
http://www.coderanch.com/t/473927/vc/recover-java-File-Deleted-Eclipse

missing source files

This is NOT a life or death issue. I do have a backup from 2 or 3 days ago. - I think the answer to this may be "Learn to always save & backup your files every night, before you turn out the lights and go home" but just in case there is a happier answer, here goes.
I was programing some Android/Java stuff in Eclipse. I left the machine on with eclipse open and a couple of source java/xml files open inside of eclipse and gave up for the night. When I sat down at the machine this morning, I had a message that windows had preformed an update, and had re-booted my machine. after re-logging in and opening Eclipse it showed the source files in edit windows and they looked normal, but as soon as I tried to type in the edit window, I got some kind of a message that "Files are derived, do I really want to edit them" (I could be wrong on the exact wording. I didn't copy the text down before hitting no or Cancel or whatever the choice was that I thought would get me out of there without doing anything). after I left that screen, it showed me a now blank edit window for the source files. I closed that and and tried to re-open the file from the Package Explorer, but it wouldn't open. So I closed Eclipse and took a look in the /src directory and it appears the source files are gone. I do have a backup from a couple of days ago, so it's not a life or death problem to go back, but my real questions are.
1- Is this a normal occurrence when a machine boots/power fails/crashes unexpectedly with source files open in Eclipse?
2 - Did I answer the "Files are derived..." question wrong? is there something I could have done at that point to rescue the file?
Any comments welcome. - Joe
If you remember where your files were, you could right click on the parent in the Project Explorer > Restore from History or Replace With > Local History.
This feels like a very basic local VCS.
Even though this is not an endless history, you can extend the size allowed for Eclipse to keep such previous versions.

Apple Script is undeleting files (Lion) and the OS keeps asking for a password. Is there a way around this.

So a funny thing happened to me last night. I was trying to clean files off my Macbook Pro.
I just purchased a new Macbook Retina and it has a smaller hard drive than my old Macbook Pro (I know cry me a river).
Anyway I was in Finder and I found a whole bunch of files and I selected them all and hit the good old delete key.
And gosh darn if my Mac didn’t immediately got to working whacking my files. What I didn’t realize that I had a view of my entire network of files including my Dropbox documents, family pictures and even some naughty images from my college years (don’t tell my wonderful wife).
The total number of deleted files was over 4,000. I almost cried.
No big deal I just go to the Trash and undelete right? Not so fast Tonto!
I want to have the files moved back to their original location. While the Lion supports this feature, it will only allow you do restore one file at a time.
With 4,000+ files my eyeballs would fall out by the time I finished.
Fortunately someone at Apple invented Apple Script.
And someone else wrote a script that will undelete files one file at a time.
I ran the script went to bed and found that it worked!!!!
Of the 4,000 file only 1,700 remained in my trash (Woo Hoo!!!).
The problem is the remaining files require me to enter a password before the restore can take place. I believe these files were created under a different owner.
My question is how can I get around this?
Is there a way to enter a super duper user mode that eliminates me having to enter a password for every file I want to undelete?
Any help is greatly appreciated.
Here is the Apple Scrpt:
repeat 4173 times --or as many files you have
tell application "Finder" to open trash --open the trash folder
tell application "Finder" to activate
tell application "System Events"
tell process "Finder"
delay 0.2 -- adjust delay as needed
key code 125 --move down to get focus on a file
key down command --hold command key
delay 0.2 -- adjust delay as needed
key code 51 --hit delete
key up command --release command
end tell
end tell
delay 0.2 -- adjust delay as needed
tell application "Finder" to close every window --close everything for the next cycle
end repeat
Fine you don't want to answer my question! I'll answer it myself (>:P).
Anyway my issue was caused by file permissions. Some files were locked down in such a way that I needed to enter a password to undelete them.
I was able to fix this using the chmod command.
Cheers!!!!