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



##########
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:
       Done. That got me thinking about the similar expression for output 
streams, and you were right in that case. Fixed that too.




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