From owner-freebsd-questions@FreeBSD.ORG Thu Sep 2 22:58:17 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 9B68D16A4CE for ; Thu, 2 Sep 2004 22:58:17 +0000 (GMT) Received: from av6-1-sn2.hy.skanova.net (av6-1-sn2.hy.skanova.net [81.228.8.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C3F043D41 for ; Thu, 2 Sep 2004 22:58:16 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: by av6-1-sn2.hy.skanova.net (Postfix, from userid 502) id 16EE837E43; Fri, 3 Sep 2004 00:58:15 +0200 (CEST) Received: from smtp2-1-sn2.hy.skanova.net (smtp2-1-sn2.hy.skanova.net [81.228.8.177]) by av6-1-sn2.hy.skanova.net (Postfix) with ESMTP id 0319737E42 for ; Fri, 3 Sep 2004 00:58:15 +0200 (CEST) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by smtp2-1-sn2.hy.skanova.net (Postfix) with SMTP id D415237E43 for ; Fri, 3 Sep 2004 00:58:14 +0200 (CEST) Received: (qmail 29236 invoked by uid 1001); 2 Sep 2004 22:58:14 -0000 Date: Fri, 3 Sep 2004 00:58:14 +0200 From: Erik Trulsson To: Danny MacMillan Message-ID: <20040902225813.GA29223@falcon.midgard.homeip.net> Mail-Followup-To: Danny MacMillan , freebsd-questions@freebsd.org References: <20040902224043.GA30143@procyon.nekulturny.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040902224043.GA30143@procyon.nekulturny.org> User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: Max # of Files in a Directory? 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: Thu, 02 Sep 2004 22:58:17 -0000 On Thu, Sep 02, 2004 at 04:40:43PM -0600, Danny MacMillan wrote: > Hi. > > I googled for this but I couldn't find an answer. > > What is the largest number of files that can exist > in a single directory in FreeBSD? I ask because > I'm using courier-imap using a Maildir mailbox > and I started seeing all kinds of errors when > trying to copy more than 16383 messages into one > of my folders there. I'm retrieving mail from a > pop3 server using Outlook then copying them into > my imap folder, also using Outlook. > > I guess my real question is, what is the bottleneck > in this situation? Outlook? courier-imap? Or > FreeBSD? I don't think there is any limit to how many files you can have in a single directory - or, if there is some limit, the limit is very large: on the order of hundreds of thousands of files or more (at which point directory operations would extremly slow anyway so nobody in his right mind would have so many files in a single directory.) There is a limit to how many subdirectories you can have in a single directory - that limit is 32765. This is tied to the how many hardlinks you can have to a single directory entry (32767: the value is stored in the inode as a signed 16-bit value) and every subdirectory contains a hardlink to its parent (the ".." entry.) Anyway, if you run into trouble when trying to copy more than 16383 messages, then it is not FreeBSD which is to blame. Personally I would bet on Outlook being the culprit, but then I am a bit prejudiced against all Microsoft products. -- Erik Trulsson ertr1013@student.uu.se