diff options
Diffstat (limited to 's3/file.go')
-rw-r--r-- | s3/file.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) { |