Simon Ford / Mbed 2 deprecated fgets

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simon
Date:
Sun Jan 03 10:49:57 2010 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r a6eefc8c816e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jan 03 10:49:57 2010 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+LocalFileSystem local("local");
+
+int main() {
+    FILE *fp = fopen("/local/lines.txt", "r");
+    
+    if(!fp) { 
+        error("Could not open file!\n");
+    }
+    
+    char buffer[128];
+    while(fgets(buffer, 128, fp)) {
+        printf("Line: %s\n", buffer);
+        wait(1);
+    }
+
+    fclose(fp);
+    
+    printf("Done\n");
+}
diff -r 000000000000 -r a6eefc8c816e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jan 03 10:49:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0