File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -800,10 +800,14 @@ func (c *Client) removeFile(path string) error {
800
800
}
801
801
switch typ {
802
802
case sshFxpStatus :
803
- return & PathError {
803
+ err = normaliseError (unmarshalStatus (id , data ))
804
+ if err == nil {
805
+ return nil
806
+ }
807
+ return & os.PathError {
804
808
Op : "remove" ,
805
809
Path : path ,
806
- Err : normaliseError ( unmarshalStatus ( id , data )) ,
810
+ Err : err ,
807
811
}
808
812
default :
809
813
return unimplementedPacketErr (typ )
@@ -822,10 +826,14 @@ func (c *Client) RemoveDirectory(path string) error {
822
826
}
823
827
switch typ {
824
828
case sshFxpStatus :
825
- return & PathError {
826
- Op : "rmdir" ,
829
+ err = normaliseError (unmarshalStatus (id , data ))
830
+ if err == nil {
831
+ return nil
832
+ }
833
+ return & os.PathError {
834
+ Op : "remove" ,
827
835
Path : path ,
828
- Err : normaliseError ( unmarshalStatus ( id , data )) ,
836
+ Err : err ,
829
837
}
830
838
default :
831
839
return unimplementedPacketErr (typ )
You can’t perform that action at this time.
0 commit comments