mirror of
https://github.com/rclone/rclone.git
synced 2025-12-17 08:43:19 +00:00
Compare commits
2 Commits
fix-9031-b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e21a7261b | ||
|
|
fd439fab62 |
@@ -311,6 +311,8 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
|
|||||||
o := &Object{
|
o := &Object{
|
||||||
fs: f,
|
fs: f,
|
||||||
remote: remote,
|
remote: remote,
|
||||||
|
mtime: srcObj.mtime,
|
||||||
|
size: srcObj.size,
|
||||||
}
|
}
|
||||||
fromFullPath := path.Join(src.Fs().Root(), srcObj.remote)
|
fromFullPath := path.Join(src.Fs().Root(), srcObj.remote)
|
||||||
toFullPath := path.Join(f.root, remote)
|
toFullPath := path.Join(f.root, remote)
|
||||||
@@ -367,7 +369,18 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
|
|||||||
return fs.ErrorDirExists
|
return fs.ErrorDirExists
|
||||||
}
|
}
|
||||||
|
|
||||||
err := f.ensureParentDirectories(ctx, dstRemote)
|
fullPathSrc := f.buildFullPath(srcRemote)
|
||||||
|
fullPathSrcUnencoded, err := url.QueryUnescape(fullPathSrc)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fullPathDstUnencoded, err := url.QueryUnescape(fullPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f.ensureParentDirectories(ctx, dstRemote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -378,6 +391,15 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = f.Move(ctx, o, dstRemote)
|
_, err = f.Move(ctx, o, dstRemote)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
|
||||||
|
f.createdDirMu.Lock()
|
||||||
|
f.createdDirs[fullPathSrcUnencoded] = false
|
||||||
|
f.createdDirs[fullPathDstUnencoded] = true
|
||||||
|
f.createdDirMu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ Note that |ls| and |lsl| recurse by default - use |--max-depth 1| to stop the re
|
|||||||
The other list commands |lsd|,|lsf|,|lsjson| do not recurse by default -
|
The other list commands |lsd|,|lsf|,|lsjson| do not recurse by default -
|
||||||
use |-R| to make them recurse.
|
use |-R| to make them recurse.
|
||||||
|
|
||||||
|
List commands prefer a recursive method that uses more memory but fewer
|
||||||
|
transactions by default. Use |--disable ListR| to suppress the behavior.
|
||||||
|
See [|--fast-list|](/docs/#fast-list) for more details.
|
||||||
|
|
||||||
Listing a nonexistent directory will produce an error except for
|
Listing a nonexistent directory will produce an error except for
|
||||||
remotes which can't have empty directories (e.g. s3, swift, or gcs -
|
remotes which can't have empty directories (e.g. s3, swift, or gcs -
|
||||||
the bucket-based remotes).`, "|", "`")
|
the bucket-based remotes).`, "|", "`")
|
||||||
|
|||||||
Reference in New Issue
Block a user