diff options
Diffstat (limited to 'src/utils/virtfs.cpp')
-rw-r--r-- | src/utils/virtfs.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/utils/virtfs.cpp b/src/utils/virtfs.cpp index 5fcb568d3..7c67deebc 100644 --- a/src/utils/virtfs.cpp +++ b/src/utils/virtfs.cpp @@ -197,9 +197,12 @@ namespace VirtFs return PHYSFS_removeFromSearchPath(oldDir.c_str()); } - const char *getRealDir(const std::string &restrict filename) + std::string getRealDir(const std::string &restrict filename) { - return PHYSFS_getRealDir(filename.c_str()); + const char *const str = PHYSFS_getRealDir(filename.c_str()); + if (str == nullptr) + return std::string(); + return str; } bool mkdir(const std::string &restrict dirname) @@ -207,6 +210,11 @@ namespace VirtFs return PHYSFS_mkdir(dirname.c_str()); } + bool remove(const std::string &restrict filename) + { + return PHYSFS_delete(filename.c_str()); + } + bool deinit() { if (PHYSFS_deinit() != 0) |