Read/Write to File

15 Nov 2012

Hi

Every time I read/write to a file, I get an error "the disk was not ejected properly. If possible always eject ..."

Is that okay? or I should be doing something before/after reading/writing to a file?

Thanks

16 Nov 2012

Hi Fatemah, are you using the local file system, i.e. that built into the mbed using the USB accessible memory or are you using an SD card or something else?

I have only used the local file system and using the test code at https://mbed.org/handbook/LocalFileSystem worked well.

The local file system is however not very forgiving of errors, so if this is what you are using let us know for a more detailed response and perhaps you could even post a small snippet of code that demonstrates the issue.

17 Nov 2012

When opening files in the LocalFileSystem, the USB mass storage device is unmounted from your PC so that both the mbed and PC don't try to access the file system at the same time. This reduces the chance of file system corruption. When this unmount occurs, you will get a message about the disk not being ejected properly. This is documented in the warning on the LocalFileSystem handbook.