diff --git a/rclonefs/fs.go b/rclonefs/fs.go index 18cace3..3616d93 100644 --- a/rclonefs/fs.go +++ b/rclonefs/fs.go @@ -108,7 +108,18 @@ func (rcfs *RCFS) Remove(name string) error { func (rcfs *RCFS) RemoveAll(path string) error { path = rcfs.AbsPath(path) - afero.Walk(rcfs, path, printNode) + afero.Walk(rcfs, path, func(path string, info fs.FileInfo, err error) error { + if err != nil { + return err + } + + if info.IsDir() { + return nil + } else { + rcfs.Remove(path) + return nil + } + }) return nil } diff --git a/rclonetest/main.go b/rclonetest/main.go index f2e9452..993c6aa 100644 --- a/rclonetest/main.go +++ b/rclonetest/main.go @@ -9,7 +9,7 @@ import ( ) func main() { - RFS, _ := rclonefs.CreateRCFS("pcloud_mv1:cfg") + RFS, _ := rclonefs.CreateRCFS("pcloud_mv1:/cfg") name := "ycfg"