Trailing backslash in COPY's dest path

Hi,

Not sure if this is considered a bug or miss use, but I didn’t see any mention for trailing backslashes in the command info page so …

When passing a path with a trailing backslash “\” in the DestPath for Copy/CopyTo command, I get a notice message and a new directory is created, which is named as the Dest directory but with an Underscore at the end.

Command:
copy "GD:/Files/Tools/file.txt" "E:\Files\Tools\"

Notice:
NOTICE: Local file system at : Replacing invalid characters in "\\Files\\Tools\"" to "\\\\?\\E:\\Files\\Tools_"

This also means that you can’t copy to the root of the drive since it can’t create the new directory. e.g:

NOTICE: Local file system at \\?\E:\: Replacing invalid characters in "\\\"" to "\\\\?\\E:\\_"
ERROR : file.txt: Failed to copy: mkdir \\?: The filename, directory name, or volume label syntax is incorrect.

Thanks.

What happened there is that in "E:\Files\Tools\" the \" at the end was interpreted as a " character which aren’t allowed in Windows file names - so rclone converted it to a _.

This is really an oddity of the windows shell rather than rclone I think.