pasnox · GitHub

Recently symlinks support in master comes with a broken move support.
It allow to copy different files that would be seen identical (regular file.ext and symlink file.ext.rclonelink) into the same folder.
See #6337 (comment)

There are test cases for these which are currently skipped.

  • // Move symlink -> regular file
    t.Run("MoveSymlinkToFile", func(t *testing.T) {
    t.Skip("FIXME not implemented")
  • // Move regular file -> symlink
    t.Run("MoveFileToSymlink", func(t *testing.T) {
    t.Skip("FIXME not implemented")
  • // Move symlink -> directory
    t.Run("MoveSymlinkToDirectory", func(t *testing.T) {
    t.Skip("FIXME not implemented")
  • // Move directory -> symlink
    t.Run("MoveDirectoryToSymlink", func(t *testing.T) {
    t.Skip("FIXME not implemented")

When done, remove the caveat in the docs added by 0ce2e12

Demo (by ncw)

mkdir /tmp/src
rclone -vv mount --vfs-links /tmp/src/ /mnt/tmp/

Then this - looks fine

$ touch /mnt/tmp/source
$ ln -s source /mnt/tmp/symlink
$ ls -l /mnt/tmp/
total 1
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:40 source
lrw-rw-r-- 1 ncw ncw 6 Dec 16 10:40 symlink -> source

The underlying remote looks OK too

$ ls -l /tmp/src/
total 4
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:40 source
-rw-rw-r-- 1 ncw ncw 6 Dec 16 10:40 symlink.rclonelink

Now create a file with the same name

$ touch /mnt/tmp/file2
$ mv /mnt/tmp/file2 /mnt/tmp/symlink
$ ls -l /mnt/tmp/
total 0
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:40 source
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:41 symlink

BUT this has created a duplicate file in the underlying remote - the symlink should have been overwritten by the file.

$ ls -l /tmp/src/
total 4
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:40 source
-rw-rw-r-- 1 ncw ncw 0 Dec 16 10:41 symlink
-rw-rw-r-- 1 ncw ncw 6 Dec 16 10:40 symlink.rclonelink

Read the original on github.com ↗