fgerlits commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044661369
##########
libminifi/test/unit/FileStreamTests.cpp:
##########
@@ -301,32 +267,25 @@ TEST_CASE("Existing file read/write test") {
stream.seek(0);
}
-#if !defined(WIN32) || defined(USE_BOOST)
-// This could be simplified with C++17 std::filesystem
TEST_CASE("Opening file without permission creates error logs") {
TestController test_controller;
auto dir = test_controller.createTempDirectory();
- std::string path_to_permissionless_file(utils::file::concat_path(dir,
"permissionless_file.txt"));
+ auto path_to_permissionless_file = dir / "permissionless_file.txt";
{
std::ofstream outfile(path_to_permissionless_file);
outfile << "this file has been just created" << std::endl;
outfile.close();
-#ifndef WIN32
utils::file::FileUtils::set_permissions(path_to_permissionless_file, 0);
-#else
- boost::filesystem::permissions(path_to_permissionless_file,
boost::filesystem::no_perms);
-#endif
}
- minifi::io::FileStream stream(path_to_permissionless_file, 0, false);
+ minifi::io::FileStream stream(path_to_permissionless_file, 0, true);
Review Comment:
thanks, makes sense
can you add this as a comment here, please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]