sftp: fix rmdir on Windows based servers (eg CrushFTP)

Before this change we used Remove to remove directories.  This works
fine on Unix based systems but not so well on Windows based ones.
Swap to using RemoveDirectory instead.
This commit is contained in:
Nick Craig-Wood 2018-11-29 21:34:37 +00:00
parent 50452207d9
commit 4b15c4215c

View File

@ -599,7 +599,7 @@ func (f *Fs) Rmdir(dir string) error {
if err != nil {
return errors.Wrap(err, "Rmdir")
}
err = c.sftpClient.Remove(root)
err = c.sftpClient.RemoveDirectory(root)
f.putSftpConnection(&c, err)
return err
}