coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

mv: Mv hardlinks windows should fail

Open dmatos2012 opened this issue 2 years ago • 5 comments

Hi,

This PR is related to #5451, but not necessarily closes it. On windows, making a hardlink would not be recognized, but now it is:

# on windows
create file named hard_link_a
mkhardlink /H hard_link_b hard_link_a

Currently:

> mv hard_link_a hard_link_b 
# removes hard_link_a 

Now:

> mv hard_link_a hard_link_b
mv: 'hard_link_a' and 'hard_link_b' are the same file 

Now with the issue related on case-insensitive OSs. Currently

touch a
mv a A

would succeed only on linux, but fail on both windows, macOs due to being case-insensitive Os. I have been trying to make it work across all OS, but changing the order of some of the error handling blows up some of the tests. Is that even something we want to support, or is the current behavior the intended one?

I have seen lots of issues with mv lately, including some I caused with my PR (sorry 😛 ) , so would like to improve at least the behavior of certain operations.

Basically I started trying to fix case-insensitive, ended up fixing moving hardlinks :P

dmatos2012 avatar Nov 05 '23 09:11 dmatos2012

GNU testsuite comparison:

Congrats! The gnu test tests/tail/symlink is no longer failing!

github-actions[bot] avatar Nov 05 '23 09:11 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail/symlink is no longer failing!

github-actions[bot] avatar Nov 06 '23 07:11 github-actions[bot]

What can we do to get this going? I believe it may be the only thing holding up integration of uu_mv into nushell. Any ideas @tertsdiepraam? Sorry to tag you. It's been a few weeks and it would be great to move forward with this.

fdncred avatar Nov 22 '23 12:11 fdncred

I'll take a look :)

tertsdiepraam avatar Nov 22 '23 12:11 tertsdiepraam

@tertsdiepraam See my comment for some of the doubts. Bit long, but well :(

Thanks again for your time always!

dmatos2012 avatar Nov 22 '23 12:11 dmatos2012