You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "anjakefala (via GitHub)" <gi...@apache.org> on 2023/02/16 18:49:03 UTC

[GitHub] [arrow] anjakefala commented on a diff in pull request #34170: GH-33618: [C++] add option needs_extended_file_info and implement localFS

anjakefala commented on code in PR #34170:
URL: https://github.com/apache/arrow/pull/34170#discussion_r1108895594


##########
cpp/src/arrow/filesystem/localfs.cc:
##########
@@ -210,6 +211,22 @@ Result<FileInfo> StatFile(const std::string& path) {
   return info;
 }
 
+Result<FileInfo> IdentifyFile(const std::string& path) {
+  FileInfo info;
+
+  if (std::filesystem::is_directory(path)) {
+    info.set_type(FileType::Directory);
+  } else if (std::filesystem::is_regular_file(path)) {
+    info.set_type(FileType::File);
+  }

Review Comment:
   `std::filesystem` supports a bunch of file types: https://en.cppreference.com/w/cpp/filesystem. Should we add any of the others to `else if`? Add a case for an empty path?



-- 
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: github-unsubscribe@arrow.apache.org

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