Semantics of "rclone cat" when the path is a duplicate name?

I think the answer to all of this is

  • it is backend dependent
  • most likely it will be the first match the backend comes across

Note that when you specify remote:hello rclone doesn't know at that moment what you are looking for - whether you expect hello to be a file or a directory. You can force rclone to consider it to be a directory by putting a / on the end (though this is somewhat backend dependent also).

So what is happening in the drive example is it finds the directory hello first, then cats all the files in it. Whereas in the s3 example, it finds the file, works out it isn't a directory marker and then cats it.

Possibly, but when you are just acting on a single thing you are invoking a whole pile of special case code which works out whether you meant a file or a directory. That is completely different code which gives the duplicate errors in the sync.

So if this was to give an error, it would need to be implemented in each backend. It would almost certainly take more transactions so slow each backend down for the case where it is trying to decide whether you've asked for the root to be pointing to a file or a directory.

1 Like