Author Topic: codeblocks clear my file, cry for help  (Read 5715 times)

yalding

  • Guest
codeblocks clear my file, cry for help
« on: March 23, 2007, 07:39:19 am »
codeblocks lost responce when I shut it down. I terminated it by force.

When I restart, the file I was editing is EMPTY! I have not back up for some time. :( :(

Anyone has idea how to bring the file back to me?

Thanks

regards,
yalding

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: codeblocks clear my file, cry for help
« Reply #1 on: March 23, 2007, 10:11:04 am »
You may want to configure the AutoSave plugin to save your work to a backup file (for example every 3 minutes). This does not bring back the work you lost today, but it will help in the future.

Before doing anything else, you should check whether the file is really empty. It may be that you only messed up with encodings. In this case, your source would still be there, the file just appears empty.
This is a dim hope, but still...

Bringing back an overwritten file the text in the empty file may be possible, but it is impossible to predict how hard it will be.
Above all else, you should avoid doing anything that writes to the hard disk in any way as the first thing.

Saving files normally works by writing to a temporary file, then doing a ternary rename, and finally unlinking the original file. Thus, any standard file recovery program should (with some luck) be able to recover the original file. However, do note that the operating system may reuse the "free" clusters for something else if you save anything to your hard disk.

Of course it is not possible to tell what exactly happens when an application freezes/crashes, so in theory it could as well be that the file was just truncated to zero length for some reason (I can't imagine why, but why not...)
In this case, a standard unerase tool would probably not find anything. However your data will still be on the disk (at least as much as fits into one cluster). It is a lot more work to get to that data than running a standard unerase program, but depending on how tough it is to restart from scratch, it may still be worth it. Booting from a Linux rescue cdrom and scanning the disk for some known string should get you near it.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

yalding

  • Guest
Re: codeblocks clear my file, cry for help
« Reply #2 on: March 23, 2007, 12:12:11 pm »
Thank you for your comments. Actually, the autosave is on. However, the problem is codeblocks clear the file. I assume the autosave is just automatical "ctrl-s"s, which does not help in my case, :(

I am working with a backup 2 weeks ago. Have to backup regularly in the future. ~

regards,
yalding

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: codeblocks clear my file, cry for help
« Reply #3 on: March 23, 2007, 01:27:49 pm »
However, the problem is codeblocks clear the file. I assume the autosave is just automatical "ctrl-s"s, which does not help in my case, :(
Autosave does not just call Ctrl-S, it saves the file to a backup file (unless you configured it to overwrite the original).

If not only the original, but also the backup file appears cleared, then please do check your encoding settings. Most likely you only use a bad encoding, and your files are *not* cleared. It is unlikely that a crash wipes out two unrelated files in the same way.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

yalding

  • Guest
Re: codeblocks clear my file, cry for help
« Reply #4 on: March 24, 2007, 05:45:55 am »
Can you tell me where codeblocks stores the backup files? I could not find them.

Thanks.

regards,
yalding

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: codeblocks clear my file, cry for help
« Reply #5 on: March 25, 2007, 07:20:11 am »
Same directory as the current file.  Just named <your file>.backup.