Author Topic: Code::Blocks crashed while I was writing code and wiped my main.cpp to be blank  (Read 6081 times)

Offline Dp-Rst

  • Multiple posting newcomer
  • *
  • Posts: 12
Hi guys, it crashed and said wx something has stopped working, i thought ok, stuff like that happens from time to time and clicked close on the pop up, reopened the project and it was blank, 55k of code wiped, I'm an Idiot so I didn't keep backups, didn't expect anything like this to happen and my pc is pretty stable, I've tried recovery software, no windows rollbacks are possible and I don't have previous versions.

Does anyone know if its possible to somehow salvage it, it there is a temp or dump or something I can use?

I've been working on this project daily for 6months, It had a small following and was growing fast in popularity, I even received money for it and thought it would be the key to my future as a game dev, so yesterday I got a shock, genuinely the worst day of this year, then after trying everything I went out and got drunk to try and get over the loss of half a years work losing my keys and phone in the process.

Sorry for the sob story but if anyone knows anything on how I could possibly hope to recover the games main.cpp please tell me and I would be eternally greatfull... hell I'll even pay you $10 on paypal... I'm desperate at this point, I've done nothing but coding for half a year with prescious little to show for it now :/

Thanks for reading and please don't hesistate to reply with absolutely anything you think could help

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
This seems to get a new hype...
http://forums.codeblocks.org/index.php/topic,20657.msg140629/topicseen.html#msg140629

i never experienced such a crash... Is your file really 0kB big? (by the way 55k code in one file and no vcs? are you insane, or perhaps a sadomasochist? )

can you tell us your operating system and what you where doing when the crash happened?

greetings

Offline Dp-Rst

  • Multiple posting newcomer
  • *
  • Posts: 12
I was just writing code when it happened, I just never really thought about back ups, clearly not the smartest person... I've lost half a year of my life to this random codeblocks crash... yup 0kb big, empty file

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
as in the other post described c::b can NOT destroy a file, without making a backup... so unless you did something really wrong there should be a backup of your old file.
What operating system are you using? where is your project folder?

Offline Dp-Rst

  • Multiple posting newcomer
  • *
  • Posts: 12
Project folder is on my desktop in a folder called the wastes, I'm sure I didn't do anything wrong it just crashed in the middle of me typing a line, no idea why.

It didn't destroy the file, it just overwrote it with a blank version

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
i still don't know your operating system (so i assume you are using windows, probably windows 8?)...
have you looked if there is a *.temp file in your project folder?
« Last Edit: October 27, 2015, 05:09:32 pm by BlueHazzard »

Offline Dp-Rst

  • Multiple posting newcomer
  • *
  • Posts: 12
Yup sorry it was windows 8.1 and there are no temp files hidden or otherwise

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
If nothing else works, you can try some file-recovery tool. You may find some on the Internet. Better run it from a USB (don't install in HD).
The thing is that a deleted file is not really deleted, but its space is marked as available. Recovery tools can search in these areas. If a new file is written with the same name the probability of recover old data is lower. If the HD is defragmented, available areas will be overwritten, which means data in those areas is lost. Generaly, every write operation lowers the probability of recovery.
You also may recover several different old data versions, since they may be written in diferent parts of the HD.

Good luck

Offline Dp-Rst

  • Multiple posting newcomer
  • *
  • Posts: 12
Hi Manolo, I already tried three internet recovery tools when it first happened each with no luck :/

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Did you try some undelete tool, it might help?

Offline CJS

  • Multiple posting newcomer
  • *
  • Posts: 12
For what it's worth, this information might help someone:

Five Best Free Data Recovery Tools
Lists TestDisk, Recuva, PhotoRec, Restoration, Undelete Plus
http://lifehacker.com/5237503/five-best-free-data-recovery-tools
There's a poll there which lists these results:
Which Free Data Recovery Tool is Best?
TestDisk  19.01%
Recuva  45.11%
PhotoRec  6.96%
Restoration  5.81%
Undelete Plus  7.22%
Other  15.88%
Total Votes: 3,130

Recuva is free/donationware and there's another review here:
http://www.pcworld.com/article/214998/Recuva.html
and here:
https://en.wikipedia.org/wiki/Recuva

I've used Recuva and NTFS Undelete, the latter is commercial but there is an old version 0.94 available on Softpedia which is freeware but may not support new formats such as NTFS5.

R-Studio is a highly recommended commercial recovery product.

This site gives advice on emergency file recovery, tools, and what you have to do to maximize the chances of a successful recovery and recommends R-Studio:

http://www.aumha.org/a/recover.htm

As for backups, I've never been comfortable with things that do it automatically or save files in some proprietary format... a lesson from the old days of Digital Microvax: One day the file system failed, recovering backups from a tape cassette was attempted, which is when you found out the recovery program didn't work because of some misconfiguration!  So, I find FreeFileSync a convenient way to compare and keep a block of user files backed up in normal file format (e.g. on HD, USB stick or SSD).

As far as I can tell the links here are bona fide, but be sure to do your own due diligence.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
I think windows 8 makes some wired things... I work on Windows7 and Linux and i never had data loss on a c::b crash.
And also after a fast look at the save code i can not find a part where c::b could possibly corrupt the original file, also at a crash. There should always be some backup copy made by c::b. One thing i can think about is, that if you have a anti virus scanner that he has destroyed your code, or at least prevented c::b for doing his job...

sry about your code, but i think it is lost in nirvana. But don't blame c::b for this ;)