int FileRmdir( const char *path ) { char *ptr; int c; if( (ptr = strchr( path, ':' )) == NULL ) { #ifdef _DEBUG printf("FileRmdir : Invalid Path (ptr = NULL)\n"); #endif return -1; } c = ptr - path; if( !strncmp( path, "pfs", 3 ) ) { return fileXioRmdir( path ); } else if( !strncmp( path, "mc0:", c ) || !strncmp( path, "mc1:", c ) ) { return fioRmdir( path ); } else if( !strncmp( path, "mass:", c ) ) { char strDir[256]; // 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; return fioRmdir( strDir ); } else if( !strncmp( path, "smb:", c ) ) { return smbc_unlink( path ); } return -1; }
bool_t FolderErase(nodecontext *p,const tchar_t* Path, bool_t Force, bool_t Safe) { return fileXioRmdir(Path) == 0; }
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; }