mirror of
https://github.com/rclone/rclone.git
synced 2025-01-10 00:08:44 +01:00
vfs: don't remove file from writers until it is transferred
This means that the list of active writers is up to date
This commit is contained in:
parent
1b22ee5b93
commit
321b6da7af
@ -143,7 +143,8 @@ func (fh *RWFileHandle) close() (err error) {
|
|||||||
fh.closed = true
|
fh.closed = true
|
||||||
rdwrMode := fh.flags & accessModeMask
|
rdwrMode := fh.flags & accessModeMask
|
||||||
if rdwrMode != os.O_RDONLY {
|
if rdwrMode != os.O_RDONLY {
|
||||||
fh.file.delWriter(fh)
|
// leave writer open until file is transferred
|
||||||
|
defer fh.file.delWriter(fh)
|
||||||
}
|
}
|
||||||
if !fh.opened {
|
if !fh.opened {
|
||||||
// If read only then return
|
// If read only then return
|
||||||
|
@ -151,7 +151,8 @@ func (fh *WriteFileHandle) close() error {
|
|||||||
return ECLOSED
|
return ECLOSED
|
||||||
}
|
}
|
||||||
fh.closed = true
|
fh.closed = true
|
||||||
fh.file.delWriter(fh)
|
// leave writer open until file is transferred
|
||||||
|
defer fh.file.delWriter(fh)
|
||||||
writeCloseErr := fh.pipeWriter.Close()
|
writeCloseErr := fh.pipeWriter.Close()
|
||||||
err := <-fh.result
|
err := <-fh.result
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user