Laurent MOULIN / Mbed 2 deprecated tinypy

Dependencies:   mbed

Revision:
0:4ab1392a0142
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stat.cpp	Sun Oct 07 11:49:09 2012 +0000
@@ -0,0 +1,22 @@
+#include "stat.h"
+
+int stat(const char *filename, struct stat *buf)
+{
+
+    /*get size*/
+    FILE* fp = 0;
+    fp = fopen(filename,"rb");
+    
+    if(fp != 0)
+    {
+        fseek(fp, 0L, SEEK_END);
+        buf->st_size = ftell(fp);
+        fclose(fp);
+        return 0;
+    }
+    else
+    {
+        buf->st_size = 0;
+        return -1;
+    }
+}
\ No newline at end of file