Lab 1 Program C
Fork of mbed by
Diff: FileSystemLike.h
- Revision:
- 8:00a04e5cd407
- Parent:
- 5:62573be585e9
- Child:
- 9:cf0d45ce28a6
--- a/FileSystemLike.h Fri Jan 23 16:26:21 2009 +0000 +++ b/FileSystemLike.h Tue Feb 03 18:02:02 2009 +0000 @@ -3,8 +3,6 @@ #ifndef MBED_FILESYSTEMLIKE_H #define MBED_FILESYSTEMLIKE_H -#include "Base.h" -#include "FileHandle.h" #ifdef __ARMCC_VERSION # define O_RDONLY 0 # define O_WRONLY 1 @@ -12,9 +10,13 @@ # define O_CREAT 0x0200 # define O_TRUNC 0x0400 # define O_APPEND 0x0008 +typedef int mode_t; #else # include <sys/fcntl.h> #endif +#include "Base.h" +#include "FileHandle.h" +#include "DirHandle.h" namespace mbed { @@ -66,6 +68,26 @@ */ virtual int rename(const char *oldname, const char *newname) { return -1; }; + /* Function opendir + * Opens a directory in the filesystem and returns a DirHandle + * representing the directory stream. + * + * Variables + * name - The name of the directory to open. + * returns - A DirHandle representing the directory stream, or + * NULL on failure. + */ + virtual DirHandle *opendir(const char *name) { return NULL; }; + + /* Function mkdir + * Creates a directory in the filesystem. + * + * Variables + * name - The name of the directory to create. + * returns - 0 on success, -1 on failure. + */ + virtual int mkdir(const char *name, mode_t mode) { return -1; } + // TODO other filesystem functions (mkdir, rm, rn, ls etc) };