sftpfs: improve remove
we know if the client asks to remove a file or directory so let's use the appropriate command without letting the sftp library guess the appropriate behavior Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
900e519ff1
commit
876bf8aa4f
1 changed files with 3 additions and 0 deletions
|
@ -335,6 +335,9 @@ func (fs *SFTPFs) Remove(name string, isDir bool) error {
|
|||
if err := fs.checkConnection(); err != nil {
|
||||
return err
|
||||
}
|
||||
if isDir {
|
||||
return fs.sftpClient.RemoveDirectory(name)
|
||||
}
|
||||
return fs.sftpClient.Remove(name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue