mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user