Traversing symlinks

Matt Mackall mpm at selenic.com
Thu May 19 15:56:51 CDT 2011


On Thu, 2011-05-19 at 21:22 +0200, Sune Foldager wrote:
> On 19-05-2011 19:42, Martin Geisler wrote:
> > Isaac Jurado<diptongo at gmail.com>  writes:
> >> Superusers can hard-link a directory? Excuse me, but I'm lost at this
> >> point:
> >>
> >>      root at findus:~# mkdir testdir
> >>      root at findus:~# ln testdir link_to_testdir
> >>      ln: `testdir': hard link not allowed for directory
> >
> > My manpage has
> >
> >          -d, -F, --directory
> >                allow  the  superuser  to attempt to hard link directories (note:
> >                will probably fail due to system restrictions, even for the supe-
> >                ruser)
> >
> > It failed for me when I tried it:
> >
> >    $ ln foo bar -d
> >    ln: creating hard link `bar' =>  `foo': Operation not permitted
> >
> 
> It (somewhat limited) supported on Mac OS X.

And even these aren't actually hardlinks (ie arbitrary graph-like
connections in an otherwise tree-shaped directory structure), they're
just presented as hardlinks to userspace. Among other things, tools like
find have a finite run-time with them. Try mounting an HFS+ drive with a
Time Machine backup under Linux (or reading Apple's tech notes on them)
and you'll see what I mean.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list