From owner-freebsd-questions@FreeBSD.ORG Tue Aug 17 14:55:08 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3F6316A4CE for ; Tue, 17 Aug 2004 14:55:08 +0000 (GMT) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by mx1.FreeBSD.org (Postfix) with SMTP id 5F42B43D4C for ; Tue, 17 Aug 2004 14:55:08 +0000 (GMT) (envelope-from dkelly@HiWAAY.net) Received: (qmail 16606 invoked by uid 0); 17 Aug 2004 14:55:10 -0000 Received: from user-69-73-60-132.knology.net (HELO ?10.0.0.68?) (69.73.60.132) by smtp1.knology.net with SMTP; 17 Aug 2004 14:55:10 -0000 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20040817052403.GE88156@wantadilla.lemis.com> References: <6.1.2.0.0.20040816220030.04148ec0@mail1.simplenet.com> <20040817052403.GE88156@wantadilla.lemis.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6BDB5047-F05D-11D8-8B80-000393BB56F2@HiWAAY.net> Content-Transfer-Encoding: 7bit From: David Kelly Date: Tue, 17 Aug 2004 09:55:03 -0500 To: FreeBSD_Questions FreeBSD_Questions X-Mailer: Apple Mail (2.619) Subject: Re: hard links for directories ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2004 14:55:08 -0000 On Aug 17, 2004, at 12:24 AM, Greg 'groggy' Lehey wrote: > On Monday, 16 August 2004 at 22:02:11 -0700, Tim Traver wrote: > >> This may be a stupid question, but is it possible to make hard links >> to >> directories ??? I know you can with files, and normally, you would do >> a >> soft link for directories, but is there any way to finagle this ? > > Sure, there are ways. But why would you want to? > > A link to a directory makes it a subdirectory of the directory > containing the link. If you have two links to a directory, where > should the directory's .. link point? How would fsck know what to do? Root is the only one allowed to make hard links to directories. As Greg says, "How would fsck know which is the correct parent directory?" Directories have only one parent. If a directory were to have two parents then you'd break the tree structure of the directory hierarchy. You would create a loop in the tree branches which would place utilities such as "find" in an infinite loop. A symbolic link works just as well and is an obvious signpost to find, fsck, tar, etc... -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Top posters will not be shown the honor of a reply.