mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
1. Fixed file_helper::exists() bug under windows which returned false in some circumstances
2. Improved file_helper::exists() performance under linux to use stat sys call 3. Added unit tests
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include "os.h"
|
||||
|
||||
#include "log_msg.h"
|
||||
|
||||
|
||||
|
||||
@@ -125,16 +125,8 @@ public:
|
||||
|
||||
static bool file_exists(const std::string& name)
|
||||
{
|
||||
FILE* file;
|
||||
if (!os::fopen_s(&file, name.c_str(), "r"))
|
||||
{
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return os::file_exists(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user