How to safely remove a USB drive on Windows CE 5.0?

Posted by Radu C on Stack Overflow See other posts from Stack Overflow or by Radu C
Published on 2010-07-20T00:24:34Z Indexed on 2011/03/13 0:10 UTC
Read the original article Hit count: 138

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.

© Stack Overflow or respective owner

Related posts about windows-ce

Related posts about filesystems