
LocalFileSystem Hello World
Legacy Warning
This is an mbed 2 example. To learn more about mbed OS 5, visit the docs.
main.cpp@0:cc465aef98cf, 2013-02-13 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Feb 13 16:36:26 2013 +0000
- Revision:
- 0:cc465aef98cf
LocalFileSystem Hello World
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:cc465aef98cf | 1 | #include "mbed.h" |
mbed_official | 0:cc465aef98cf | 2 | |
mbed_official | 0:cc465aef98cf | 3 | LocalFileSystem local("local"); // Create the local filesystem under the name "local" |
mbed_official | 0:cc465aef98cf | 4 | |
mbed_official | 0:cc465aef98cf | 5 | int main() { |
mbed_official | 0:cc465aef98cf | 6 | FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing |
mbed_official | 0:cc465aef98cf | 7 | fprintf(fp, "Hello World!"); |
mbed_official | 0:cc465aef98cf | 8 | fclose(fp); |
mbed_official | 0:cc465aef98cf | 9 | } |