How to safely remove a USB drive on Windows CE 5.0?
- by Radu C
Until today, I assumed that Windows CE was writing everything to disk and I wouldn't end up with a broken FAT16 when I removed the USB stick. Today, I was proven wrong.
I use a USB stick to test things on a WinCE 5.0 device. I don't write anything from the app or WinCE to the stick. I just execute my app, and my app reads its settings and pictures from the stick. Today, just this order of operations broke my stick filesystem (and I have to fix it).
Is there a way to tell WinCE 5.0 to unmount the stick before I remove it? It sees it as a "Hard Drive", and the tap-and-hold menu has nothing along the lines of "safely remove drive".
I'm happy with both code to do this operation and some trick that I didn't find in Windows CE yet. Thank you.