Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:3c8241f877e9, committed 2019-10-01
- Comitter:
- lozeonjyu
- Date:
- Tue Oct 01 22:28:19 2019 +0000
- Commit message:
- 123
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Oct 01 22:28:19 2019 +0000
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include "mbed.h"
+#include "LocalFileSystem.h"
+
+LocalFileSystem local("local");
+
+int main()
+{
+ FILE *fp;
+
+ printf("testing\n");
+
+ fp = fopen("/test.txt","w");
+
+ if(fp)
+ printf("opened\n");
+ else
+ printf("not opened\n");
+
+
+ fprintf(fp, "This is testing for fprintf...\n");
+ fputs("This is testing for fputs...\n", fp);
+ fclose(fp);
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main1.cpp Tue Oct 01 22:28:19 2019 +0000
@@ -0,0 +1,17 @@
+#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);
+ remove("/local/out.txt"); // Removes the file "out.txt" from the local file system
+
+ DIR *d = opendir("/local"); // Opens the root directory of the local file system
+ struct dirent *p;
+ while((p = readdir(d)) != NULL) { // Print the names of the files in the local file system
+ printf("%s\n", p->d_name); // to stdout.
+ }
+ closedir(d);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Oct 01 22:28:19 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file