From owner-freebsd-questions@FreeBSD.ORG Tue May 25 08:42:55 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 3B52916A4CE for ; Tue, 25 May 2004 08:42:55 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CC7A43D1D for ; Tue, 25 May 2004 08:42:54 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i4PFgg8J032843; Tue, 25 May 2004 10:42:42 -0500 (CDT) (envelope-from dan) Date: Tue, 25 May 2004 10:42:42 -0500 From: Dan Nelson To: Jason DiCioccio Message-ID: <20040525154242.GL75036@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: Question regarding reported directory sizes. 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, 25 May 2004 15:42:55 -0000 In the last episode (May 25), Jason DiCioccio said: > I know this question may seem silly.. However, here's my scenario. > > I have a very large directory (say, a mail spool) whose directory entry is > approx 606K.. > drwx------ 5 cyrus cyrus 606208 May 25 10:29 . > Now.. That directory had a lot of files in it. However, after deleting all > of the files in that directory, the directory entry's size stays the same. > I realize this is fairly unimportant, however is there a way to 'garbage > collect' that directory entry and all others like it? Create another file in the directory, and you'll see it shrink down. The truncation code is in the file create codepath, not the delete one (which means it's not constantly trying to shrink the directory as you delete files). -- Dan Nelson dnelson@allantgroup.com