coryan commented on a change in pull request #11976:
URL: https://github.com/apache/arrow/pull/11976#discussion_r772359773



##########
File path: cpp/src/arrow/filesystem/gcsfs.cc
##########
@@ -96,28 +96,29 @@ class GcsInputStream : public arrow::io::InputStream {
   // @name FileInterface
   Status Close() override {
     stream_.Close();
+    closed_ = true;
     return Status::OK();
   }
 
   Result<int64_t> Tell() const override {
-    if (!stream_) {
-      return Status::IOError("invalid stream");
-    }
+    if (closed()) return Status::Invalid("Cannot use Tell() on a closed 
stream");
     return stream_.tellg() + offset_;
   }
 
-  bool closed() const override { return !stream_.IsOpen(); }
+  bool closed() const override { return closed_ && !stream_.IsOpen(); }

Review comment:
       Yes.  zero-length objects are "born closed" in `google-cloud-cpp`.  
Probably a bug (or at least a very poorly thought API), but you can `read()` 
from them, while they  return `IsOpen() == false`.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to