selkhateeb / hardlink Goto Github PK
View Code? Open in Web Editor NEWa simple command-line utility that implements hardlinks on Mac OsX
a simple command-line utility that implements hardlinks on Mac OsX
I created hardlinks in a directory and now I'm struggling to remember which are hard links and which are in fact the files themselves.
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.
I do not know if I am dreaming or not but it could be useful to have the list of all hard links. Why ? This will avoid to loose some directory hard linked to others when we forget that.
I successfully used hardlink to hardlink a directory. Woot! I then tried to hardlink to the same source from from a different destination directory, but I'm getting the following error:
$> hardlink: file exists
Any idea why I am getting this error? I've tried it from multiple destination directories and with the same effect.
I have been experiencing a bizarre issue that I now contribute to hardlinks in MAC OS X. I am using them for Googledrive. If you create a hardlink to a directory you are unable to search for files in finder search bar unless you choose "This Mac" instead of the current location. If you use Spotlight it works fine. If you rename the file and rename it back again it works fine until you reboot. I can recreate this behavior on demand. Once I removed the hardlinks everything was fine without even having to reboot. UNfortunately I need ot search these directories regularly so going to have to say good bye to Googledrive.
Please add OSI-approved license. :)
I get this error
╰─$ hardlink /Volumes/Nimbus/Box\ Sync Box\ Sync 1 ↵
hardlink: Cross-device link
It appears that
rm -rf
on hard link deletes original files
this is dangerous and on Linux if you rm the hard link the original file is still intact.
Can you confirm / deny this behavior with your lib on MacOS?
harlink is not working in APFS macOS High Sierra.
It shows "Error: Operation not permitted". Do we have any other way to create hardlink for directories in APFS .
Thanks & Regards,
Karthikeyan
Might have happened earlier, but now all runs get "operation not permitted", even when the destination is inside another directory. :(
This fails on 10.8/Mountain Lion, even if I sudo the command:
hardlink: Operation not permitted
"Hardlinks can not be created under the same directory root." I am having trouble understand what this means. Does it mean that hardlinks cannot be created if they share the same parent or grandparent directory?
A picture would help in this case.
I edited the stackoverflow answer where this is listed (pending peer review) and created an edit to README to reflect the possibility of trying to unlink a non-hardlinked directory may orphan files ore entire directory trees, causing the permanent storage version of a memory leak.
Note: While I haven't tried it (Using High Sierra with the new FS doesn't let me create hardlinks properly) it should be possible to orphan files this way. Would recommend some sort of check in the code itself, however a bit red note in the README may be sufficient. Either way, important to know!
Dear selkhateeb,
would you kindly provide the binary, so that one does not need to install gcc first?
Thanks ;)
When I run the command with full disk access, it returns Operation not permitted
when trying to hard link directories.
It generates an empty regular file which is not a directory.
It would be good to add list of conditions that hard link must meet to README:
The file system must be journaled HFS+.
The parent directories of the source and destination must be different.
The source’s parent must not be the root directory.
The destination must not be in the root directory.
The destination must not be a descendent of the source.
The destination must not have any ancestor that’s a directory hard link.
Taken from: http://osxbook.com/blog/2008/11/09/hfsdebug-40-and-new-hfs-features/
Hi Sam,
I'm interested in making a unix manual page for this project as I like it and have never created one before.
I have researched it but may need some help as I am a student looking to improve my unix and coding skills and think this might be a good start for me.
If you would like me to contribute to this project, please feel free to contact me.
Like the behavior in ln, if the target directory already exists, then create a link in that directory instead, to make the following command work:
ln ~/blablabla .
I can't create a hardlink, even when I log in as root (which is normally disabled on MacOS and is a member of "wheel" with full administrative and system rights). I have checked all the hardlink conditions, yet I still receive an "operation not permitted" error.
Tried using the "hardlink -u" command and it just said Operation not permitted. Not sure why its very strange
Hello,
At every attempted link I get hln: File exists, I tried multiple source & destination folders but to no avail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.