mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-27 06:04:25 +01:00
This commit is contained in:
@@ -328,9 +328,12 @@ bool FioRemove(const std::string &filename)
|
||||
{
|
||||
std::filesystem::path path = OTTD2FS(filename);
|
||||
std::error_code error_code;
|
||||
std::filesystem::remove(path, error_code);
|
||||
if (error_code) {
|
||||
Debug(misc, 0, "Removing {} failed: {}", filename, error_code.message());
|
||||
if (!std::filesystem::remove(path, error_code)) {
|
||||
if (error_code) {
|
||||
Debug(misc, 0, "Removing {} failed: {}", filename, error_code.message());
|
||||
} else {
|
||||
Debug(misc, 0, "Removing {} failed: file does not exist", filename);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user