anjakefala commented on code in PR #34170: URL: https://github.com/apache/arrow/pull/34170#discussion_r1180791788
########## cpp/src/arrow/filesystem/localfs.cc: ########## @@ -240,6 +261,36 @@ Status StatSelector(const PlatformFilename& dir_fn, const FileSelector& select, return Status::OK(); } +Status IdentifyFileSelector(const PlatformFilename& dir_fn, const FileSelector& select, Review Comment: `IdentifyFile` requires an `std::filesystem::path` while `StatFile` requires `std::wstring` or `std::string`. Because it can use `std::filesystem::path` `IdentifyFile` takes advantage of the performance boost of `directory_iterator` for its loop. Basically, There is enough unique logic that combining them is looking uglier. The main thing they have in common is the boilerplate at the start that checks for the existence of the file. I think the better thing to do is to factor out that code, instead of trying to combine the rest. -- 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]
