NO

Author Topic: Restore a backup  (Read 5217 times)

CLR

  • Guest
Restore a backup
« on: November 22, 2004, 07:46:04 PM »
Hello.

How do I restore a backup of source file? I'm getting that 'full of zeros' error.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Restore a backup
« Reply #1 on: November 22, 2004, 10:50:34 PM »
Hello,

As I understood the previous reports about this, the source files were always destroyed because of a system reset.

I try to handle this by keeping a backup copy while the file is being edited. If it's closed normally, the backup is removed. If a system reset occurs while in the IDE, and you later open a source file that was open when the reset occurred, you should get a message box asking if you want to load the backup file instead. This should happen automatically, but only if 'Make backup copies of source files' is checked on the 'General' tab in Tools -> Options.

Pelle
/Pelle

Ngan Lo

  • Guest
Restore a backup
« Reply #2 on: November 30, 2004, 05:43:25 AM »
i experienced a interesting problem, here, i opened 2 PellesC for testing my library, created simple project with default main.h/.c in both PellesC, so they have the same source code files name, then i code something in both project, later i closed one, & continue coding the other one, but the system had a problem while i debugging it, the IDE debugger halted, & my system halted too so i cannot reboot normally, i pressed the reset button...

after i restart my system, i open up the 1st closed project, the main.c is "....", the file damaged, then i open the other project (halted one), it ask me about restoring the file (main.c), i click "Yes" & it restore OK.

i close the 1st project & open again, it ask me to restore the main.c, i feel strange & i click "Yes", it restore the 2nd project's main.c to my 1st project, very interesting.

so it looks like PellesC cannot handle 2 same file name, right Pelle ?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Restore a backup
« Reply #3 on: November 30, 2004, 06:51:37 PM »
Yes, this is a problem. I don't want to scatter backup files all over the hard drive - and I want the name of the backup file to be readable. Not sure how to solve this right now.

Pelle
/Pelle

Ngan Lo

  • Guest
Restore a backup
« Reply #4 on: December 01, 2004, 01:52:55 AM »
yes, i understand your concern.  :wink:

how about this, add a project name as a file-prefix, like "project1_main.c" "project2_main.c", i know this is not easy, just a suggestion.  :)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Restore a backup
« Reply #5 on: December 01, 2004, 02:46:34 PM »
Yes, this might work. Thanks for the tip! I will try to do something to the next release...

Pelle
/Pelle