diff options
author | Quentin <quentin@deuxfleurs.fr> | 2021-11-20 09:53:05 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2021-11-20 09:53:05 +0100 |
commit | 4448577ec154e1f175be3f6668de0aa2d6bfff9e (patch) | |
tree | 840e9979d06d1f2117629821b1935d7f9d65fe2b /s3 | |
parent | 514731cf4b5dd97dc871b9fd84c4d9938900ef79 (diff) | |
download | bagage-4448577ec154e1f175be3f6668de0aa2d6bfff9e.tar.gz bagage-4448577ec154e1f175be3f6668de0aa2d6bfff9e.zip |
Path + format
Diffstat (limited to 's3')
-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) { |