This code is causing me trouble. Supposedly, one of "rw" or "r+" should allow both reading and writing to a file. However, I can't get either to work. The code below ought to print "Writable and now readable" to out.txt, but only prints "Writable".
#include "mbed.h"
LocalFileSystem local("local");
int main()
{
FILE *fp = fopen("/local/out.txt", "w");
fprintf(fp,"Writable");
fclose(fp);
fp = fopen("/local/out.txt", "rw"); \\or "r+"
fprintf(fp,"and now readable");
fclose(fp);
}
Any advice?
This code is causing me trouble. Supposedly, one of "rw" or "r+" should allow both reading and writing to a file. However, I can't get either to work. The code below ought to print "Writable and now readable" to out.txt, but only prints "Writable".
Any advice?