btrfs
btrfs copied to clipboard
ReflinkCopyW is broken with destination paths longer than one element.
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.