Added fsdevDeleteDirectoryRecursively

This commit is contained in:
Adubbz 2019-05-05 17:34:04 +10:00 committed by fincs
parent afaa33df2e
commit 1d3e208807
2 changed files with 13 additions and 0 deletions

View File

@ -48,5 +48,8 @@ int fsdevTranslatePath(const char *path, FsFileSystem** device, char *outpath);
/// This calls fsFsSetArchiveBit on the filesystem specified by the input absolute path.
Result fsdevSetArchiveBit(const char *path);
/// Recursively deletes the directory specified by the input absolute path.
Result fsdevDeleteDirectoryRecursively(const char *path);
/// Unmounts all devices and cleans up any resources used by the FS driver.
Result fsdevUnmountAll(void);

View File

@ -380,6 +380,16 @@ Result fsdevSetArchiveBit(const char *path) {
return fsFsSetArchiveBit(&device->fs, fs_path);
}
Result fsdevDeleteDirectoryRecursively(const char *path) {
char fs_path[FS_MAX_PATH];
fsdev_fsdevice *device = NULL;
if(fsdev_getfspath(_REENT, path, &device, fs_path)==-1)
return MAKERESULT(Module_Libnx, LibnxError_NotFound);
return fsFsDeleteDirectoryRecursively(&device->fs, fs_path);
}
/*! Initialize SDMC device */
Result fsdevMountSdmc(void)
{