it's fat!

Fork of FATFileSystem by mbed official

Revision:
10:28e685e5ff7f
Parent:
9:e2ab678eb692
Child:
11:f430519973b0
diff -r e2ab678eb692 -r 28e685e5ff7f FATFileSystem.cpp
--- a/FATFileSystem.cpp	Sat Jul 30 20:47:51 2016 +0000
+++ b/FATFileSystem.cpp	Mon Jul 10 15:37:41 2017 +0000
@@ -100,6 +100,16 @@
     return new FATFileHandle(fh);
 }
 
+int FATFileSystem::open(FileHandle **file, const char *name, int flags) {
+    FileHandle *temp = open(name, flags);
+    if (!temp) {
+        return -1;
+    }
+    
+    *file = temp;
+    return 0;
+}
+
 int FATFileSystem::remove(const char *filename) {
     FRESULT res = f_unlink(filename);
     if (res) {
@@ -136,6 +146,16 @@
     return new FATDirHandle(dir);
 }
 
+int FATFileSystem::open(DirHandle **dir, const char *name) {
+    DirHandle *temp = opendir(name);
+    if (!temp) {
+        return -1;
+    }
+    
+    *dir = temp;
+    return 0;
+}
+
 int FATFileSystem::mkdir(const char *name, mode_t mode) {
     FRESULT res = f_mkdir(name);
     return res == 0 ? 0 : -1;