LocalFileSystem path support?

17 Nov 2010

If a LocalFileSystem is declared in the usual way, an attempt to access a file in a subdirectory returns an error. E.g.

#include "mbed.h"
LocalFileSystem local("local");

int main() {
    FILE *fp1 = fopen("/local/foo/fee.htm", "r");  
    // fp1 always returns an error
    fclose(fp1);    
}
This works if the target file is in the root directory, but not if it is in a sub-directory.

Am I missing something, or are paths not supported by the LocalFileSystem?

17 Nov 2010

Hi Hexley,

You are not missing anything. Paths are not supported on the LocalFileSystem. I've just added some notes to the LocalFileSystem page; thanks for highlighting this.

Note that these restrictions are specific to the LocalFileSystem, so if you move to an SD card or USB Disk (or any other implementation someone might put together), you could use directories.