[DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Things you’d like to miss in the future...
c0thirty
Posts: 23
Joined: 27 Oct 2021 14:28

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by c0thirty »

Windows 10 still natively has bizarre behavior with junctions. Attempting to move or cut/paste a junction using Windows Explorer ends up creating a new non-junction folder, moving all the contents of the original source folder into it, and leaving behind both the original (now empty) folder and the junction linking to it. They're a weird grey area between symlinks and hard links and I'm not sure exactly what safety if any they offer over hard links. In my recent test just now, deleting the junction (whether via recycle bin or permanent delete) rather than moving it didn't delete the source folder's contents, but I'm sure it would have on earlier Windows versions.

admin
Site Admin
Posts: 60632
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by admin »

Yes, in XP deleting the junction meant deleting the original stuff. Horror show. And yes, it's generally a messy area. I never use junctions for my own stuff, I just have them here for testing.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by PeterH »

You know that hardlinks *must* refer to the same disk partition they are in?
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60632
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by admin »

So?

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by PeterH »

I think so. Will go to verify.
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60632
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by admin »

I meant "So?" in the sense of "So what?" :) What's your point?

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: [DATA LOSS] Deleting junctions resulted in deletion of junction target contents

Post by PeterH »

c0thirty said: They're a weird grey area between symlinks and hard links and I'm not sure exactly what safety if any they offer over hard links.

I'd say you can't / shouldn't compare these, as hardlinks are different usage as symlinks.
Win11 Pro 223H2 Gerrman

Post Reply