DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: corrupted file after power disruption  (Read 8,638 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
corrupted file after power disruption
« on: November 26, 2008, 12:26 PM »
hello

I was using a software (mirc) and this software reads a txt file (script.ini) to perform some actions, it does NOT write on this file anything

but when the power of the laptop stopped, and I had to reboot, this file was corrupted (it contained NULL characters when opened with notepad)

1. is there a way to restore it?

2. why this happened? I mean, since there was no write activity at this file at all, why just reading the file got the file corrupted? is it winxp or hard disk's fault?

3. how can I prevent such failures in the future?

thanks

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: corrupted file after power disruption
« Reply #1 on: November 26, 2008, 01:32 PM »
Can't answer 1 or 2.

For 3 - why did the power fail?

If the battery has run out there is not much you can do except plugin the computer.

If it is a power failure to your power supply either make sure you have a charged battery installed or get a UPS so that even without mains power you have sufficient time to shut down your system (or use software to automatically shutdown cleanly on power failure).

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: corrupted file after power disruption
« Reply #2 on: November 26, 2008, 01:57 PM »
it's a laptop and it run out of battery

is there a program that can ensure that some crucial files (eg some ini's) are safe from such disaster?

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: corrupted file after power disruption
« Reply #3 on: November 26, 2008, 02:11 PM »
I haven't looked in Vista but in XP if you go to Control Panel > Power Options there is an alarm tab which lets you set a battery level where an alarm is given and an action can be set.

You could set this so that at 10% battery life left it warns you and at 5% battery life it automatically hibernates.

That way if you are at the computer you can grab a power lead if it is to hand and if you have left it unattended it can look after itself!

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: corrupted file after power disruption
« Reply #4 on: November 26, 2008, 05:22 PM »
If you're using NTFS as filesystem, this shouldn't happen - unless mIRC is doing something stupid... which it might very well be doing :)
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=15890.0