wgtmac commented on code in PR #34170:
URL: https://github.com/apache/arrow/pull/34170#discussion_r1154643583
##########
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:
Is it better to open an issue to track it? Otherwise a TODO comment like
this is not actionable and may never be addressed.
##########
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:
It seems to share a lot of common logic from `StatSelector`. Is is possible
to modify it directly?
##########
cpp/src/arrow/filesystem/localfs.cc:
##########
@@ -310,7 +361,11 @@ Result<std::vector<FileInfo>>
LocalFileSystem::GetFileInfo(const FileSelector& s
RETURN_NOT_OK(ValidatePath(select.base_dir));
ARROW_ASSIGN_OR_RAISE(auto fn,
PlatformFilename::FromString(select.base_dir));
std::vector<FileInfo> results;
- RETURN_NOT_OK(StatSelector(fn, select, 0, &results));
+ if (select.needs_extended_file_info == true) {
Review Comment:
```suggestion
if (select.needs_extended_file_info) {
```
--
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]