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/04/27 20:38:28 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_r1179653321


##########
cpp/src/arrow/filesystem/localfs.cc:
##########
@@ -212,6 +213,26 @@ Result<FileInfo> StatFile(const std::string& path) {
 
 #endif
 
+Result<FileInfo> IdentifyFile(const std::filesystem::path path) {
+  FileInfo info;
+
+  if (std::filesystem::is_directory(path)) {
+    info.set_type(FileType::Directory);
+  } else if (std::filesystem::is_regular_file(path) ||
+             std::filesystem::is_symlink(path)) {
+    info.set_type(FileType::File);
+  } else {
+    info.set_type(FileType::Unknown);
+  }
+
+  info.set_mtime(kNoTime);
+  info.set_size(kNoSize);
+  // TODO does it need to be wstring in windows?

Review Comment:
   This is a draft! Part of the goal was to ensure all TODOs were addressed before merging. But, I wanted to communicate the work that I knew remained.



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