From 307f5d846e1513ef609b76e2d6cea035c8465b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Fri, 1 Nov 2002 15:26:06 +0000 Subject: Added remove() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2801 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/dir.h | 1 + firmware/common/file.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'firmware/common') diff --git a/firmware/common/dir.h b/firmware/common/dir.h index 1ac8fcd..6b275ab 100644 --- a/firmware/common/dir.h +++ b/firmware/common/dir.h @@ -72,6 +72,7 @@ typedef struct DIRtag extern DIR* opendir(char* name); extern int closedir(DIR* dir); +extern int mkdir(char* name); extern struct dirent* readdir(DIR* dir); diff --git a/firmware/common/file.c b/firmware/common/file.c index ae55604..7f0e0cd 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -184,6 +184,20 @@ int close(int fd) return rc; } +int remove(const char* name) +{ + int rc; + int fd = open(name, O_WRONLY); + if ( fd < 0 ) + return fd; + + rc = fat_remove(&(openfiles[fd].fatfile)); + + close(fd); + + return rc; +} + static int readwrite(int fd, void* buf, int count, bool write) { int sectors; -- cgit v1.1