Fix recursive directory removal across platforms

Add FileSystem::dirRemoveAll() to normalize trailing separators and use the non-throwing std::filesystem::remove_all overload.

Migrate ecode and unit-test cleanup call sites to the centralized helper, preventing Haiku from crashing when removing directories with trailing slashes during shutdown.
This commit is contained in:
Martín Lucas Golini
2026-08-18 13:37:56 -03:00
parent 1b2927e129
commit 01ebd7a82d
8 changed files with 43 additions and 43 deletions
+5
View File
@@ -81,6 +81,11 @@ class EE_API FileSystem {
/** Deletes a file from the file system. */
static bool fileRemove( const std::string& filepath );
/** Recursively deletes a directory and all of its contents.
* @return True if the directory was removed or did not exist, false on error.
*/
static bool dirRemoveAll( const std::string& path );
/** Moves a file or folder to the destination path
* @param fromPath The path of the file or folder to move
* @param toPath The folder / directory destination path