btrfs icon indicating copy to clipboard operation
btrfs copied to clipboard

ReflinkCopyW is broken with destination paths longer than one element.

Open Ryex opened this issue 3 years ago • 0 comments

When ReflinkCopyW is given a destination path the file is linked to the filename concatenated to the second to last element in the path.

IE:

call with

".\some\file\path\foo.txt foo.txt.bak"
---
.
└─── foo.txt.bak

call with

".\some\file\path\foo.txt .\foo.txt.bak"
---
.
└─── .foo.txt.bak

call with (presuming the target dir exists))

".\some\file\path\foo.txt  .\deeper\bar\foo.txt"
---
.
└───deeper
     └───bar
     └───barfoo.txt

call with (presuming the target dir exists))

".\some\file\path\foo.txt  .\deeper\bar\..\foo.txt"
---
.
└───deeper
     └───bar
         └──..foo.txt

I can replicate this behavior both with rundll32.exe and by calling it via LoadLibrary GetProcAddress

This can be worked around in my use case in a backward compatible way if it gets fixed but it's not really all the nice.

Ryex avatar Feb 10 '23 13:02 Ryex