You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/03/29 12:31:22 UTC

[GitHub] [incubator-doris] stdpain commented on a change in pull request #5579: [Refactor] Remove boost filesystem

stdpain commented on a change in pull request #5579:
URL: https://github.com/apache/incubator-doris/pull/5579#discussion_r603251184



##########
File path: be/src/util/filesystem_util.cc
##########
@@ -21,28 +21,25 @@
 #include <sys/resource.h>
 #include <sys/stat.h>
 
-#include <boost/filesystem.hpp>
+#include <filesystem>
 
 #include "util/error_util.h"
 
-namespace errc = boost::system::errc;
-namespace filesystem = boost::filesystem;
-
-using boost::system::error_code;
+using std::error_code;
 using std::exception;
 using std::string;
 using std::vector;
 
-// boost::filesystem functions must be given an errcode parameter to avoid the variants
+// std::filesystem functions must be given an errcode parameter to avoid the variants
 // of those functions that throw exceptions.
 namespace doris {
 
 Status FileSystemUtil::create_directory(const string& directory) {
     error_code errcode;
-    bool exists = filesystem::exists(directory, errcode);
+    bool exists = std::filesystem::exists(directory, errcode);
     // Need to check for no_such_file_or_directory error case - Boost's exists() sometimes
     // returns an error when it should simply return false.
-    if (errcode != errc::success && errcode != errc::no_such_file_or_directory) {
+    if (errcode&& errcode != std::errc::no_such_file_or_directory) {

Review comment:
       need a code format here




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org