Thread: going mental - autorecovery system

  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    going mental - autorecovery system

    I have beentrying to think of a way to do this for ages and am slowly going mad.

    I have a filtering engine that scans the entered message for disallowed words. THe filter can be enabled or disabled and its state is recorded internally in a variable scannerStatus as either 0 or 1. For error handling i want to include an auto-recover should this variable become corrupt (as the scanner will have an unkown state) as this is network software security and error systems are paramount.

    I can detect if the scannerStatus has an errounous value - but if it does i want to auto-correct it to the last state, so i need to record the state as it changes, if i simply copy it - the copy will become corrupt as well as the original - so thats no help. is tere a way of 'locking' a variable and then 'unlocking' when i wish to access it. Storing it in a text file seems a little ineffcient and it is possible it may become overwritten with corrupt value.

    tVMia
    Monday - what a way to spend a seventh of your life

  2. #2
    Unregistered
    Guest
    use three variables: inputchange, current status, and backup

    every time inputchanged is used, first check it to make sure it is not corrupt. Then, set backup equal to current status. Then, set current status equal to inputchange. You can check as often as you want if currentstatus is corrupt and if it is, you can set it equal to backup. To make it even less hackable, you can even backup your backup variable and with the same value that is in it, but under a different name. Good Luck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File System Implementation
    By dodgeviper in forum C Programming
    Replies: 9
    Last Post: 11-16-2007, 01:04 PM
  2. Using system icons
    By @nthony in forum Windows Programming
    Replies: 1
    Last Post: 01-13-2007, 07:56 PM
  3. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  4. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 05:35 PM
  5. BIOS system and memory allocation problem
    By beely in forum Tech Board
    Replies: 9
    Last Post: 11-25-2003, 07:12 AM