static int sd_fat_mkdir_r (struct _reent *r, const char *path, int mode) { sd_fat_private_t *dev = sd_fat_get_device_data(path); if(!dev) { r->_errno = ENODEV; return -1; } OSLockMutex(dev->pMutex); char *real_path = sd_fat_real_path(path, dev); if(!real_path) { r->_errno = ENOMEM; OSUnlockMutex(dev->pMutex); return -1; } int result = FSMakeDir(dev->pClient, dev->pCmd, real_path, -1); free(real_path); OSUnlockMutex(dev->pMutex); if(result < 0) { r->_errno = result; return -1; } return 0; }
static int FSDrvMkdir(struct _reent* r, const char* path, int mode) { FSStatus err = FSMakeDir(fsClient, fsCmdBlock, path, FS_RET_ALL_ERROR); if(err != FS_STATUS_OK) { FSDrvReportError(r); return -1; } return 0; }
FSStatus SAVEMakeDir(FSClient *client, FSCmdBlock *block, uint8_t account, const char *path, uint32_t flags) { auto fsPath = internal::getSavePath(account, path); return FSMakeDir(client, block, fsPath.path().c_str(), flags); }