forked from mirror/afero
fix ReadAt
This commit is contained in:
parent
709edc9d8f
commit
e151fe9493
|
@ -193,8 +193,11 @@ func (f *File) Read(b []byte) (n int, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *File) ReadAt(b []byte, off int64) (n int, err error) {
|
func (f *File) ReadAt(b []byte, off int64) (n int, err error) {
|
||||||
|
prev := atomic.LoadInt64(&f.at)
|
||||||
atomic.StoreInt64(&f.at, off)
|
atomic.StoreInt64(&f.at, off)
|
||||||
return f.Read(b)
|
n, err = f.Read(b)
|
||||||
|
atomic.StoreInt64(&f.at, prev)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *File) Truncate(size int64) error {
|
func (f *File) Truncate(size int64) error {
|
||||||
|
|
Loading…
Reference in New Issue