Skip to content

Instantly share code, notes, and snippets.

@kommen
Created April 15, 2011 15:18
Show Gist options
  • Save kommen/921866 to your computer and use it in GitHub Desktop.
Save kommen/921866 to your computer and use it in GitHub Desktop.
What?
Command line tool to create hard links to directories with Mac OS X (10.5 or later). This is used by Time Machine.
Credits:
http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html
http://osxbook.com/blog/2008/11/09/hfsdebug-40-and-new-hfs-features/
Restrictions:
The hard link must be created in a directory different from the source directory's parent. See example below.
How?
Compile:
$ gcc -o hlink hlink.c -Wall
Link:
./hlink <source_dir> <target_dir>
Example:
$ mkdir test1
$ mkdir test2
$ ./hlink test1 test2/test3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment