Seaven commented on a change in pull request #2089: Change refactor and 
reorganize the file utils 
URL: https://github.com/apache/incubator-doris/pull/2089#discussion_r342896658
 
 

 ##########
 File path: be/src/env/env_posix.cpp
 ##########
 @@ -597,6 +599,26 @@ class PosixEnv : public Env {
         return Status::OK();
     }
 
+    Status is_directory(const std::string& path, bool* is_dir) override {
+        struct stat path_stat;
+        if (stat(path.c_str(), &path_stat) != 0) {
+            return io_error(path, errno);
+        } else {
+            *is_dir = S_ISDIR(path_stat.st_mode);
+        }
+
+        return Status::OK();
+    }
+
+    Status canonicalize(const std::string& path, std::string* result) override 
{
+        std::unique_ptr<char[], kudu::FreeDeleter> r(realpath(path.c_str(), 
nullptr));
 
 Review comment:
   Yeah, the namespace is kudu in gutil/gscoped_ptr.h , maybe we should modify 
to doris?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to