mufs: implement mufs_rmdir()

This commit is contained in:
S.J.R. van Schaik 2017-06-12 15:35:15 +02:00
parent 3b531e868b
commit d6fa387868
2 changed files with 14 additions and 0 deletions

View file

@ -288,3 +288,16 @@ int mufs_mkdir(struct mufs *fs, const char *path)
{
return mufs_mkpath(fs, path, MUFS_DIR);
}
int mufs_rmdir(struct mufs *fs, const char *path)
{
struct mufs_stat stat;
if (mufs_stat(fs, path, &stat) < 0)
return -1;
if (stat.type != MUFS_DIR || stat.file_size != 0)
return -1;
return mufs_rmpath(fs, path);
}