mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 01:20:16 +02:00
local: fix crash on Stat error while reading a file
This commit is contained in:
@@ -671,6 +671,9 @@ type localOpenFile struct {
|
||||
func (file *localOpenFile) Read(p []byte) (n int, err error) {
|
||||
// Check if file has the same size and modTime
|
||||
fi, err := file.fd.Stat()
|
||||
if err != nil {
|
||||
return 0, errors.Wrap(err, "can't read status of source file while transferring")
|
||||
}
|
||||
if file.o.size != fi.Size() || file.o.modTime != fi.ModTime() {
|
||||
return 0, errors.New("can't copy - source file is being updated")
|
||||
}
|
||||
|
Reference in New Issue
Block a user