1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-29 05:47:23 +02:00

Get rid of LimitedFs - FIXME needs docs on copying single files

If remote:path points to a file make NewFs return a sentinel error
fs.ErrorIsFile and an Fs which points to the parent.

Use this to remove the LimitedFs and just add this file to the
--files-from list.

This means that server side operations can be used also.

Fixes #518
Fixes #545
This commit is contained in:
Nick Craig-Wood
2016-06-21 18:01:53 +01:00
parent 5a3b109e25
commit 1a87b69376
26 changed files with 101 additions and 239 deletions

View File

@@ -239,7 +239,8 @@ func NewFs(name, root string) (fs.Fs, error) {
}
obj := f.NewFsObject(remote)
if obj != nil {
return fs.NewLimited(f, obj), nil
// return an error with an fs which points to the parent
return f, fs.ErrorIsFile
}
f.root = oldRoot
}