felipecrv commented on code in PR #40147:
URL: https://github.com/apache/arrow/pull/40147#discussion_r1512981240


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -1214,6 +1215,24 @@ Status SetObjectMetadata(const std::shared_ptr<const 
KeyValueMetadata>& metadata
   return Status::OK();
 }
 
+bool IsDirectory(std::string_view key, const S3Model::HeadObjectResult& 
result) {
+  // If it has a non-zero length, it's a regular file
+  if (result.GetContentLength() > 0) {
+    return false;
+  }

Review Comment:
   I know, but we can limit the Arrow implementation in saying that it's unable 
to reason about files ending with a `/`. Directories without a `/` should be 
OK. It won't read and won't create files at keys ending with a `/`. Without 
this, it's really hard to offer filesystem operations that behave as expected.



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