Re: Hard links to directories
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com My .02, Mike On Oct 2, 2008, at 8:50 PM, Chris Idou wrote: --- On Thu, 10/2/08, Kevin Elliott <kelliott@mac.com> wrote: From: Kevin Elliott <kelliott@mac.com> Subject: Re: Hard links to directories To: idou747@yahoo.com Cc: darwin-kernel@lists.apple.com Date: Thursday, October 2, 2008, 3:32 PM On Oct 1, 2008, at 8:00 PM, Chris Idou wrote:
A couple more questions:
1) How do permissions work? I notice that the system seems to stop you doing dangerous things like hardlinking /System to somewhere, even as root, but its not clear why this case is different.
Can't shed any light on that. As someone else has mentioned, directory hard links should effectively be considered SPI. If you want help understanding them so you can work better with TimeMachine, that's great. If you think you can use them to solve some other unrelated problem, then your making a mistake and should reconsider what your trying to do.
2) I notice that once a directory has been hardlinked, it is forever tainted in some fashion. If I hardlink a directory somewhere, then unlink the 2nd link, then the original directory can never be trashed in the Finder for example. Such an attempt will fail, even though it is apparently no different to any other directory. Can anyone enlighten me about this? Yes, that's true. The first time a directory is hard linked, both directories become hard links. Once something is hard linked, there is no concept of the "original" directory, just 1 or more hard links. Not sure why the finders failing- I'd have to give it a try and look into it further. At the very least, you should probably file a bug. -Kevin Elliott kelliott@mac.com http://web.mac.com/kelliott/
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/tegtmeye%40eecis.udel.e... _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I'm not sure they are doing what you are accusing them of. Every flavor of *nix that supports it has some nonportable nuance. Hard linking to directories is implementation defined behavior-end of story. See http://www.opengroup.org/onlinepubs/009695399/functions/link.html In most circles, this means that the implementors can do whatever stable or unstable thing pleases them, especially since it really isn't documented. This could very well be a .01 release that only works in the specific case of how time machine is using it. In short, it is hard to get mad at flakey behavior when your playing around with the bleeding edge. Remember when Microsoft was busted using secret APIs to make their in-house apps better than anyone else's apps, and everyone though that stunk and was anti-competitive? I don't see why this sort of stuff should be considered some kind of private detail of Time Machine. Especially since it is in the kernel, and the API is a public one. The behavior of the API is undocumented, but it shouldn't be. The behavior of all public APIs should be fully documented and available to all. BTW, I do realise that linking directories is pretty dangerous, but that's in large part because none of the utilities or libraries take the possibility into account. This is part of the reason I'm interested in how it behaves. This email sent to tegtmeye@eecis.udel.edu This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Tegtmeyer