aboutsummaryrefslogtreecommitdiff
path: root/s3/file.go
diff options
context:
space:
mode:
Diffstat (limited to 's3/file.go')
-rw-r--r--s3/file.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/s3/file.go b/s3/file.go
index 40b40a1..3d59aa2 100644
--- a/s3/file.go
+++ b/s3/file.go
@@ -19,6 +19,7 @@ type S3File struct {
objw *io.PipeWriter
donew chan error
pos int64
+ eof bool
entries []fs.FileInfo
Path S3Path
}
@@ -85,12 +86,19 @@ func (f *S3File) Read(p []byte) (n int, err error) {
}
func (f *S3File) ReadAt(p []byte, off int64) (n int, err error) {
+ if f.eof {
+ return 0, io.EOF
+ }
+
log.Printf("s3 ReadAt %v\n", off)
if err := f.loadObject(); err != nil {
return 0, err
}
- return f.obj.ReadAt(p, off)
+ n, err = f.obj.ReadAt(p, off)
+ f.eof = err == io.EOF
+
+ return
}
func (f *S3File) WriteAt(p []byte, off int64) (n int, err error) {