Switch from fsDelete to remove.

This commit is contained in:
Steven Smith 2015-05-02 11:56:57 -07:00
parent 6f32b0b00f
commit 876adcfcad

View File

@ -3,13 +3,14 @@
#include <ctrcommon/platform.hpp> #include <ctrcommon/platform.hpp>
#include <ctrcommon/ui.hpp> #include <ctrcommon/ui.hpp>
#include <sys/dirent.h>
#include <sys/errno.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <sys/dirent.h>
typedef enum { typedef enum {
INSTALL_CIA, INSTALL_CIA,
DELETE_CIA, DELETE_CIA,
@ -73,7 +74,7 @@ int main(int argc, char **argv) {
} }
std::stringstream stream; std::stringstream stream;
stream << "FBI v1.3.7" << "\n"; stream << "FBI v1.3.8" << "\n";
stream << "Free Space: " << freeSpace << " bytes (" << std::fixed << std::setprecision(2) << freeSpace / 1024.0f / 1024.0f << "MB)" << "\n"; stream << "Free Space: " << freeSpace << " bytes (" << std::fixed << std::setprecision(2) << freeSpace / 1024.0f / 1024.0f << "MB)" << "\n";
stream << "Destination: " << (destination == NAND ? "NAND" : "SD") << ", Mode: " << (mode == INSTALL_CIA ? "Install CIA" : mode == DELETE_CIA ? "Delete CIA" : mode == DELETE_TITLE ? "Delete Title" : "Launch Title") << "\n"; stream << "Destination: " << (destination == NAND ? "NAND" : "SD") << ", Mode: " << (mode == INSTALL_CIA ? "Install CIA" : mode == DELETE_CIA ? "Delete CIA" : mode == DELETE_TITLE ? "Delete Title" : "Launch Title") << "\n";
stream << "L - Switch Destination, R - Switch Mode" << "\n"; stream << "L - Switch Destination, R - Switch Mode" << "\n";
@ -212,11 +213,11 @@ int main(int argc, char **argv) {
deleteStream << displayFileName << " (" << currItem << ")" << "\n"; deleteStream << displayFileName << " (" << currItem << ")" << "\n";
uiDisplayMessage(TOP_SCREEN, deleteStream.str()); uiDisplayMessage(TOP_SCREEN, deleteStream.str());
if(!fsDelete(path)) { if(remove(path.c_str()) != 0) {
std::stringstream resultMsg; std::stringstream resultMsg;
resultMsg << "Delete failed!" << "\n"; resultMsg << "Delete failed!" << "\n";
resultMsg << displayFileName << "\n"; resultMsg << displayFileName << "\n";
resultMsg << platformGetErrorString(platformGetError()) << "\n"; resultMsg << strerror(errno) << "\n";
uiPrompt(TOP_SCREEN, resultMsg.str(), false); uiPrompt(TOP_SCREEN, resultMsg.str(), false);
failed = true; failed = true;
break; break;
@ -266,12 +267,12 @@ int main(int argc, char **argv) {
} }
} else { } else {
uiDisplayMessage(TOP_SCREEN, "Deleting CIA..."); uiDisplayMessage(TOP_SCREEN, "Deleting CIA...");
if(fsDelete(path)) { if(remove(path.c_str()) != 0) {
updateList = true; updateList = true;
resultMsg << "succeeded!"; resultMsg << "succeeded!";
} else { } else {
resultMsg << "failed!" << "\n"; resultMsg << "failed!" << "\n";
resultMsg << platformGetErrorString(platformGetError()) << "\n"; resultMsg << strerror(errno) << "\n";
} }
} }