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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]