This commit is contained in:
Bel LaPointe
2021-03-28 13:12:15 -05:00
commit be2a031834
46 changed files with 11740 additions and 0 deletions

24
rclone/list.go Executable file
View File

@@ -0,0 +1,24 @@
package rclone
import (
_ "github.com/ncw/rclone/backend/drive"
_ "github.com/ncw/rclone/backend/local"
_ "github.com/ncw/rclone/backend/s3"
"github.com/ncw/rclone/fs"
)
func (rc *RClone) List(destination string) ([]string, error) {
f, err := fs.NewFs(destination)
if err != nil {
return nil, err
}
entries, err := f.List("")
if err != nil {
return nil, err
}
names := make([]string, len(entries))
for i, entry := range entries {
names[i] = entry.Remote()
}
return names, nil
}