diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/dir.h | 1 | ||||
-rw-r--r-- | firmware/common/file.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/firmware/common/dir.h b/firmware/common/dir.h index 1ac8fcd312..6b275abda8 100644 --- a/firmware/common/dir.h +++ b/firmware/common/dir.h | |||
@@ -72,6 +72,7 @@ typedef struct DIRtag | |||
72 | 72 | ||
73 | extern DIR* opendir(char* name); | 73 | extern DIR* opendir(char* name); |
74 | extern int closedir(DIR* dir); | 74 | extern int closedir(DIR* dir); |
75 | extern int mkdir(char* name); | ||
75 | 76 | ||
76 | extern struct dirent* readdir(DIR* dir); | 77 | extern struct dirent* readdir(DIR* dir); |
77 | 78 | ||
diff --git a/firmware/common/file.c b/firmware/common/file.c index ae5560407b..7f0e0cd9bd 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -184,6 +184,20 @@ int close(int fd) | |||
184 | return rc; | 184 | return rc; |
185 | } | 185 | } |
186 | 186 | ||
187 | int remove(const char* name) | ||
188 | { | ||
189 | int rc; | ||
190 | int fd = open(name, O_WRONLY); | ||
191 | if ( fd < 0 ) | ||
192 | return fd; | ||
193 | |||
194 | rc = fat_remove(&(openfiles[fd].fatfile)); | ||
195 | |||
196 | close(fd); | ||
197 | |||
198 | return rc; | ||
199 | } | ||
200 | |||
187 | static int readwrite(int fd, void* buf, int count, bool write) | 201 | static int readwrite(int fd, void* buf, int count, bool write) |
188 | { | 202 | { |
189 | int sectors; | 203 | int sectors; |