How to specify a drive letter when providing a path via RC?

What is the problem you are having with rclone?

Im creating managed bindings in .NET for RClone. Ive got the RPC interface working and I can copy files to my local machine from a given remote. The problem I have is that the RPC command for operations/copyfile takes in a dstFs and a dstRemote, which is fine but it doesn't appear to let me change the local file system drive letter from C:\.

My current configuration is:

    "srcFs": "myRemote:",
    "srcRemote": "file.txt",
    "dstFs": "/",
    "dstRemote": "/file.txt"

If I run the config as is, I get no errors and the file is copied to the path on the C drive.

However, if I try change dstRemote to an absolute windows path i.e E:\file.txt, I get the following:

2023/12/20 01:30:46 ERROR : fdst: local, fsrc: myRemote, dstFileName: E:\file.txt, srcFileName: file.txt, dstFilePath: /?/C:/E:\file.txt, srcFilePath: file.txt
2023/12/20 01:30:46 ERROR : file.txt: Failed to copy: The system cannot find the file specified.
2023/12/20 01:30:46 ERROR : rc: "operations/copyfile": error: The system cannot find the file specified.

The first error within the log is extra logging I placed in this build of librclone to print out the variables so I can see what is happening.

As seen, RClone doesnt replace the C drive letter, but rather appends the new one: dstFilePath: /?/C:/E:\file.txt

Is this behaviour expected and I'm just doing something wrong, or is this a bug within Rclone?

Run the command 'rclone version' and share the full output of the command.


After searching for a few days, it appears the answer is to use absolute file paths on Windows via the prefix: \\?\. This is mentioned in the docs located here: Local Filesystem

So in my instance, the correct file path would be \\?\E:\file.txt.

I would note that the docs only mention this concept very vaguely and doesn't dive into much detail.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.