summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/dir.h1
-rw-r--r--firmware/common/file.c14
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
73extern DIR* opendir(char* name); 73extern DIR* opendir(char* name);
74extern int closedir(DIR* dir); 74extern int closedir(DIR* dir);
75extern int mkdir(char* name);
75 76
76extern struct dirent* readdir(DIR* dir); 77extern 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
187int 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
187static int readwrite(int fd, void* buf, int count, bool write) 201static int readwrite(int fd, void* buf, int count, bool write)
188{ 202{
189 int sectors; 203 int sectors;