static int sd_fat_unlink_r (struct _reent *r, const char *name) { sd_fat_private_t *dev = sd_fat_get_device_data(name); if(!dev) { r->_errno = ENODEV; return -1; } OSLockMutex(dev->pMutex); char *real_path = sd_fat_real_path(name, dev); if(!real_path) { r->_errno = ENOMEM; OSUnlockMutex(dev->pMutex); return -1; } int result = FSRemove(dev->pClient, dev->pCmd, real_path, -1); free(real_path); OSUnlockMutex(dev->pMutex); if(result < 0) { r->_errno = result; return -1; } return 0; }
int __wut_fs_rmdir(struct _reent *r, const char *name) { FSStatus rc; if (name == NULL) { return -1; } char *path_fix = __wut_fs_fixpath(r, name); if (!path_fix) { r->_errno = ENOMEM; return -1; } // Set up command block FSCmdBlock fsCmd; FSInitCmdBlock(&fsCmd); rc = FSRemove(__wut_devoptab_fs_client, &fsCmd, path_fix, -1); free(path_fix); if (rc >= 0) { return 0; } r->_errno = __wut_fs_translate_error(rc); return -1; }
static int FSDrvUnlink(struct _reent* r, const char* name) { FSStatus err = FSRemove(fsClient, fsCmdBlock, name, FS_RET_ALL_ERROR); if(err != FS_STATUS_OK) { FSDrvReportError(r); return -1; } return 0; }
FSStatus SAVERemove(FSClient *client, FSCmdBlock *block, uint8_t account, const char *path, uint32_t flags) { auto fsPath = internal::getSavePath(account, path); return FSRemove(client, block, fsPath.path().c_str(), flags); }