void AsyncFio::remove(const char *path) { int res; WaitSema(_ioSema); checkSync(); fileXioRemove(path); fileXioWaitAsync(FXIO_WAIT, &res); SignalSema(_ioSema); }
static void appDeleteItem(int id) { struct config_value_t* cur = appGetConfigValue(id); fileXioRemove(cur->val); cur->key[0] = '\0'; configApps->modified = 1; configWrite(configApps); appForceUpdate = 1; }
int hddRemoveFilesystem(t_hddFilesystem *fs) { int rv; if(!hddStatusCurrent) hddUpdateInfo(); rv = fileXioRemove(fs->filename); hddUpdateInfo(); return rv; }
int FileRemove( const char *file ) { char *ptr; int c; if( (ptr = strchr( file, ':' )) == NULL ) { #ifdef _DEBUG printf("FileRemove : Invalid Path (ptr = NULL)\n"); #endif return -1; } c = ptr - file; if( !strncmp( file, "pfs", 3 ) ) { return fileXioRemove( file ); } else if( !strncmp( file, "mc0:", c ) || !strncmp( file, "mc1:", c ) ) { // there's a bug in the fio stuff that creates a new directory // whenever a file is removed with fioRemove. c = fioRemove( file ); fioRmdir( file ); return c; } else if( !strncmp( file, "mass:", c ) ) { char strDir[256]; c = fioRemove( file ); // you MUST call fioRmdir with device number for USB device. strcpy( strDir, "mass0" ); strcat( strDir, ptr ); // need to remove trailing '/' or fioRmdir won't work if( strDir[ strlen(strDir) - 1 ] == '/' ) strDir[ strlen(strDir) - 1 ] = 0x0; fioRmdir( strDir ); return c; } else if( !strncmp( file, "smb:", c ) ) { return smbc_unlink( file ); } return -1; }
bool_t FileErase(nodecontext *p,const tchar_t* Path, bool_t Force, bool_t Safe) { bool_t Result = fileXioRemove(Path)==0; fileXioRmdir(Path); // workaround for the bug in the ROM that creates a directory right after removing the file return Result; }