-
-
Save carloe/1340067 to your computer and use it in GitHub Desktop.
Easy way to create hard links on os x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdio.h> | |
int main(int argc, char* argv[]) { | |
if (argc != 3) { | |
fprintf(stderr,"Use: hlink <src_dir> <target_dir>\n"); | |
return 1; | |
} | |
int ret = link(argv[1],argv[2]); | |
if (ret != 0) | |
perror("link"); | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the
ln
command on OS X has been cannibalized and does not support creating hard links to folders. This tool is an easy workaround.