pitrou commented on code in PR #38845:
URL: https://github.com/apache/arrow/pull/38845#discussion_r1415329842


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -2408,7 +2408,16 @@ class S3FileSystem::Impl : public 
std::enable_shared_from_this<S3FileSystem::Imp
                   std::vector<std::string> file_paths;
                   for (const auto& file_info : file_infos) {
                     DCHECK_GT(file_info.path().size(), bucket.size());
-                    file_paths.push_back(file_info.path().substr(bucket.size() 
+ 1));
+                    auto file_path = file_info.path().substr(bucket.size() + 
1);
+                    if (file_info.IsDirectory()) {
+                      // the selector returns FileInfo objects for directories 
with a
+                      // a path that never ends in a trailing slash, but for 
S3 the file
+                      // needs to have a trailing slash to recognize it as 
direcotory
+                      // (https://github.com/apache/arrow/issues/38618)

Review Comment:
   ```suggestion
                         // The selector returns FileInfo objects for 
directories with a
                         // a path that never ends in a trailing slash, but for 
AWS the file
                         // needs to have a trailing slash to recognize it as 
directory
                         // (https://github.com/apache/arrow/issues/38618)
   ```



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

Reply via email to