arpadboda commented on a change in pull request #489: MINIFICPP-740: Add
ability to run NiFi processors from Java and Python
URL: https://github.com/apache/nifi-minifi-cpp/pull/489#discussion_r260296446
##########
File path: libminifi/include/utils/file/FileManager.h
##########
@@ -79,9 +95,15 @@ class FileManager {
#ifdef BOOST_VERSION
return boost::filesystem::unique_path().native();
#else
- std::string file_name = "/tmp/" +
non_repeating_string_generator_.generate();
+ std::string tmpDir = "/tmp";
+ #ifdef WIN32
+ TCHAR lpTempPathBuffer[MAX_PATH];
+ GetTempPath(MAX_PATH, lpTempPathBuffer);
+ tmpDir = lpTempPathBuffer;
+ #endif
+ std::string file_name = tmpDir + FILE_SEPARATOR +
non_repeating_string_generator_.generate();
while (!verify_not_exist(file_name)) {
- file_name = "/tmp/" + non_repeating_string_generator_.generate();
+ file_name = tmpDir + FILE_SEPARATOR +
non_repeating_string_generator_.generate();
Review comment:
Filesystem in cpp17 is really missed here... :(
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services