-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CVS-154703, Implement createTempPath(std::string* local_path) for windows #2879
base: main
Are you sure you want to change the base?
Conversation
Enable those unit tests for the change: "test/localfilesystem_test.cpp", |
…nt test/localfilesystem_test.cpp unit test
src/filesystem.hpp
Outdated
|
||
DWORD path_len = GetTempPathW(MAX_PATH, temp_path); | ||
if (path_len == 0 || path_len > MAX_PATH) { | ||
SPDLOG_LOGGER_ERROR(modelmanager_logger, "Failed to get temp path: {}", GetLastError()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add logging error message:
DWORD error = GetLastError();
std::string message = std::system_category().message(error);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add message to log in all LastError cases.
src/filesystem.hpp
Outdated
#elif _WIN32 | ||
static StatusCode createTempPath(std::string* local_path) { | ||
if (!local_path) | ||
return StatusCode::FILESYSTEM_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add log here that target temp path is not set: SPDLOG_LOGGER_ERROR(modelmanager_logger, "Target path variable for createTempPAth not set. {}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following the commit and the modify the code
} | ||
#elif _WIN32 | ||
static StatusCode createTempPath(std::string* local_path) { | ||
if (!local_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error path should be in { } for the local_path check
🛠 Summary
Implement createTempPath(std::string* local_path) for windows
JIRA/Issue: CVS-154703
🧪 Checklist
``