wjones127 commented on code in PR #34170:
URL: https://github.com/apache/arrow/pull/34170#discussion_r1109048683
##########
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:
We should probably ignore entries that aren't files or directories. Except
maybe symlinks.
--
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]