mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Seeking to offset while doing readAt with non-zero offset
This commit is contained in:
@@ -331,6 +331,9 @@ func (d *AllocDir) ReadAt(path string, offset int64, limit int64) (io.ReadCloser
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := f.Seek(offset, 0); err != nil {
|
||||
return nil, fmt.Errorf("can't seek to offset %q: %v", offset, err)
|
||||
}
|
||||
return &ReadCloserWrapper{Reader: io.LimitReader(f, limit), Closer: f}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user