Problem writing to text file

Hello,
I have problem writing to a text file. I can open mbed in my computers directory but the file simply wont be created an nothing is written to it. Have tried using an example code but even this wont work. I am using mbed os5. Does anyone know what this depends on?

#include “mbed.h”

LocalFileSystem local(“local”); // Create the local filesystem under the name “local”

int main() {
FILE *fp = fopen(“/local/out.txt”, “w”); // Open “out.txt” on the local file system for writing
fprintf(fp, “Hello World!”);
fclose(fp);
}

Hello,

what a board are you using as target? The LocalFileSystem is only available on the LPC1768 and LPC11U24.

LPC1768 using MbedOS6 with LocalFileSystem - Mbed OS - Arm Mbed OS support forum

BR, Jan

I’m using a NXP LPC1768

Then try to look to discussion I linked above.

BR, Jan