In message <1BD1B35E65@firga.sun.ac.za> PICLIST@MITVMA.MIT.EDU writes: > Hi, > > > Another problem with periodic saving is that if power fails during a save > > the data may be garbled. One solution to this would be to save two > > copies with a scheme such as CRC applied to each copy to check if it is > > valid. If upon turning the power back on, a copy fails the CRC the other > > one would be used. The bad copy would be fixed by rewriting it from the > > good one. (If both copies fail CRC, obviously this is a problem. This > > shouldn't happen if it is just power on/off causing garbled data to be > > written) > > A method I have used keeps two copies of the data and a pointer byte. > I write alternately to the one or the other. I first write the data and > then write the single pointer byte to indicate which of the entries > contain the most recent info. This method makes sure that the data you > read is always valid (although it might not be the newest data). > Niki, Is there not a danger with this method that the pointer location could get corrupted if it is being written at the same time that the power is being removed? Have you a mechanism to deal with that? Best regards, Mike Watson