aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

Recovery a zero-ed D file #539

Closed MachAsm closed 10 years ago

MachAsm commented 10 years ago

I was using mono for D and somehow my computer lost power and some of the D files on this project became zero byte file (http://en.wikipedia.org/wiki/Zero_byte_file). File size of both files keep intact but the contents was filled with zeroes. Can I get back the contents of these files? does mono has a something which backup last x changes to a file or so? thanks.

aBothe commented 10 years ago

There are autosaves of files. ~/.cache/MonoDevelop-5.0/AutoSave/ I'd also try to use your fs' journal to revert unfinished changes (if you're on linux).

MachAsm commented 10 years ago

Thanks for your quick answer. I'm using Windows 8.1. Is there an equivalent?

aBothe commented 10 years ago

Then I don't have any idea. Hopefully you've stored the code in some online repo :P

MachAsm commented 10 years ago

Well, should I did turned on this auto save? I found on windows \AppData\Local\XamarinStudio-5.0\Cache\AutoSave but it is empty. And no, I didn't stored the code in a online repo. I had it on an external hard drive but I needed to format it and didn't put the files back. :/

EDIT:

Another strage beavior was when I turned on my computer the "file projects history" which does appear in the menu bar on left side was empty. I didn't cleaned anything.

aBothe commented 10 years ago

Perhaps you could try to chkdsk your partition and let it restore broken parts.

MachAsm commented 10 years ago

I'll try it. Thanks. What I've tried too was search for that files on hard drive using a hex editor. But wasn't much useful. I got small blocks (say, 100 lines out 800) of the files which isn't even my last edit. So a bit useless. Any ideas why is my AutoSave directory empty?

aBothe commented 10 years ago

autosaves are there e.g. if you decide not to save a while when closing XS. I don't know other autosave triggers though

MachAsm commented 10 years ago

so bad. I'll probably end up rewriting everything. :( this time I'll turn on Windows local files history. Thanks for your time, anyway!

aBothe commented 10 years ago

Or..have some online repo (or just a repo on a LAN server or even just a backup on a second drive). But yeah, perhaps there are other ways to try to restore stuff (like with http://www.cgsecurity.org/wiki/TestDisk) or so.. anyway I'll close this issue due to being quite OT. Good luck with restoring everything!