7 years, 5 months ago.

mdot compilation error with "LocalFileSystem_HelloWorld - main.cpp" example

I'm used mdot platform. The example send my this compilation error:

/media/uploads/SergioValiente/error_compilaci-n.jpg

What is the problem? thanks you

1 Answer

7 years, 5 months ago.

The mdot is not using the LocalFileSystem APIs, but rather has it's own. See the header here. The functions are called saveUserFile / readUserFile / etc.

Accepted Answer

Ok... isn't there a example of the use?

posted by Sergio Valiente 19 Jun 2017

F.e.:

    // write a file
    const char text[] = "Hello world";
    bool res = dot->saveUserFile("test.txt", (void*)text, sizeof(text));
    printf("Saved file. Success=%d\n", res);
    
    // read a file
    char buffer[128] = { 0 };
    dot->readUserFile("test.txt", buffer, sizeof(buffer));
    buffer[127] = 0; // make sure to 0 terminate the returning string
    printf("Read back. Text is %s\n", buffer);
posted by Jan Jongboom 19 Jun 2017

I run your code on my mdot, but I didn't find the test.txt, where is it stored? Thanks.

posted by Weitao xu 14 Aug 2017

Where are you looking? It will not show up on the USB mounted drive as it does not use the internal flash for that, but rather 'fakes' a file system. The only way to access the files is through the readUserFile APIs.

posted by Jan Jongboom 14 Aug 2017