hardlink icon indicating copy to clipboard operation
hardlink copied to clipboard

Folders not getting deleted after unlinking - Finder

Open kulal opened this issue 8 years ago • 9 comments

I am able to implement hardlinks on macOS using this command-line utility, but I am seeing an issue after unlinking an folder. Issue: Unable to delete the unlinked folder from finder (command used to unlink "hln -u destination") same folder can be deleted from terminal using "rm"

Any idea where the permission is getting changed ? and what might be the cause for this issue.

kulal avatar Feb 09 '17 13:02 kulal

What version of command line tools are you using?

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

Not sure this is the right way to do it but I get: version: 8.2.0.0.1.1480973914

jamespayne avatar Feb 09 '17 13:02 jamespayne

Version of command line tool is : 8.1.0.0.1.1476494586

I have even verified this using the latest version of Xcode command line tool

kulal avatar Feb 09 '17 14:02 kulal

Are you compiling the source or installing via homebrew?

jamespayne avatar Feb 09 '17 14:02 jamespayne

I just tried what you mentioned above. Can't reproduce this. What are the permissions on the folders?

jamespayne avatar Feb 09 '17 15:02 jamespayne

Please try to replicating the issue in this way: Create a folder under /Users/user/Desktop/Unlinked-folder Source: /Users/user/Desktop/Unlinked-folder Destination: /Users/user/linked

Command to hard link folder: hln /Users/user/Desktop/Unlinked-folder /Users/user/linked/Unlinked-folder

Now if I try to delete the (source) /Users/user/Desktop/Unlinked-folder or (destination) /Users/user/linked/Unlinked-folder

I get promoted with admin credentials to authenticate, but even after giving the password the folders will remain without deleting: screen shot 2017-02-13 at 6 10 07 pm screen shot 2017-02-13 at 6 10 59 pm screen shot 2017-02-13 at 6 14 00 pm

Even after removing hard link i am unable to delete the source folder : /Users/user/Desktop/Unlinked-folder

Only way to delete is through terminal... running "rm -r"

Is this the normal behavior or am i missing any thing here..?

kulal avatar Feb 13 '17 12:02 kulal

I had this issue too, when trying to delete the usual way in finder. a sudo rm -rf works though

jvsteiner avatar Feb 17 '17 14:02 jvsteiner

This may be a protection against orphaning files... Which version of macOS are each of you using?

alt-jero avatar Mar 07 '18 22:03 alt-jero

I believe it was El Capitan. This was a year ago though, so I might be wrong.

jvsteiner avatar Mar 08 '18 06:03 jvsteiner

My thinking is that if it was happening for you and @kulal but not for @jamespayne , and @jamespayne happened to be using an older macOS, that the issue might be something Apple implemented as a feature. @kulal, @jamespayne : ideas?

alt-jero avatar Mar 08 '18 17:03 alt-jero