From owner-freebsd-questions Mon Jun 24 16:47:51 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA24202 for questions-outgoing; Mon, 24 Jun 1996 16:47:51 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id QAA24194 for ; Mon, 24 Jun 1996 16:47:48 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id QAA02712; Mon, 24 Jun 1996 16:43:00 -0700 From: Terry Lambert Message-Id: <199606242343.QAA02712@phaeton.artisoft.com> Subject: Re: int link(const int inode, const char *name2) To: bill@twwells.com (T. William Wells) Date: Mon, 24 Jun 1996 16:42:59 -0700 (MST) Cc: freebsd-questions@freebsd.org In-Reply-To: <4qn6te$rmi@twwells.com> from "T. William Wells" at Jun 24, 96 07:04:14 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > : I've accidentally unlinked a file (or rather, had it unlinked for me by gzip > : -- still my mistake) from the directory it was in. The file is, however, > : still open. If I can get the inode (downloading lsof now), is it possible > : to link it to the directory again? > > When you unlink a file, the inode doesn't get modified, except to > update the link count (and inode modification time). If you crash > your machine by hitting reset, the inode will still be on disk but > with a zero reference count. In _theory_ fsck will detect this > and put the file in lost+found. If you *manually* fsck. The default is to *clear* the inode. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.