Vicky
Vicky

Reputation: 1117

Robustness of file handling in windows mobile against power failure (data recovery)

I am writing a c# .net CF application for windows mobile 6, which does some file handling. I wanted to know if there is any built-in way to make the file handling robust against power failure. For instance, if there is a power failure while writing the file, the file contents should be intact without corruption(maybe there is loss of the data being written at the time of power loss, but not already existing data in the file). The next time the power is up, the file contents should be present as before the power failure.

Thanks in advance.

Upvotes: 1

Views: 599

Answers (1)

nitzmahone
nitzmahone

Reputation: 13940

In my experience with numerous industrial Windows Mobile/Windows CE devices over the years (Symbol/Motorola, Toshiba, Intermec, etc), you can't guarantee much of anything around data integrity on the local storage. After a power failure event, the data will often be partially corrupted or, more frequently, completely gone. This isn't really the fault of Windows Mobile- it's just the way the flash storage subsystems are built. They're "non-volatile" on clean power on/off, but power fail on in-progress writes is usually fatal. Our current Symbol/Moto WM6 devices get bricked and need reflashing every few weeks when someone drains the battery too far.

If you have a mostly-available network, I'd suggest offloading or augmenting your local storage with device-specific network storage where possible (eg fileshare, webservice, etc).

Bottom line: non-volatile storage on these devices is a convenience and shouldn't be trusted with important long-term storage.

Upvotes: 2

Related Questions