From owner-freebsd-questions@FreeBSD.ORG Mon Jul 27 13:03:45 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBB8A106566C for ; Mon, 27 Jul 2009 13:03:45 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4118FC26 for ; Mon, 27 Jul 2009 13:03:45 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 98357 invoked by uid 89); 27 Jul 2009 13:04:03 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 27 Jul 2009 13:04:02 -0000 In-Reply-To: <200907261109.44586.mel.flynn+fbsd.questions@mailing.thruhere.net> References: <20090725222918.AC51DB7E0@kev.msw.wpafb.af.mil> <200907260045.12045.mel.flynn+fbsd.questions@mailing.thruhere.net> <8A69BBD9-5F3C-44B8-96C0-586C1B5A386F@identry.com> <200907261109.44586.mel.flynn+fbsd.questions@mailing.thruhere.net> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8AF593F8-DA94-4C54-89E2-155988886331@identry.com> Content-Transfer-Encoding: 7bit From: John Almberg Date: Mon, 27 Jul 2009 09:03:43 -0400 To: Mel Flynn X-Mailer: Apple Mail (2.753.1) Cc: freebsd-questions@freebsd.org Subject: Re: limit to number of files seen by ls? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:03:46 -0000 >> understanding what is going on. I'm reading up on this, and as soon >> as I know enough to either understand the issue, or ask an >> intelligent question, I will do so... > > When a program is executed with arguments, there is a system > imposed limit on > the size of this argument list. On FreeBSD this limit can be seen > with sysctl > kern.argmax, which is the length in bytes. > When you do "ls *", what really happens is that the shell expands > the asterisk > to all entries in the current directory, except entries starting > with a dot > ("hidden" files and directories). As a result, ls is really called as: > ls file1 file2 .... fileN > > If the string length of file1 to fileN is bigger then kern.argmax, > then you > will get argument list too long error. Mel, What I get is this: > sysctl kern.argmax kern.argmax: 262144 Which is why I'm starting to think that (a) my problem is different or (b) I'm so clueless that there isn't any problem at all, and I'm just not understanding something (most likely scenario!) I'm going to write a little script that generates a bunch of files to test my hypothesis that once I get more than n files in a directory, some things stop working correctly, like ls and ftp directory listings, and to discover the value of n. That will give me some hard data to work with. This problem has been nagging at me for a while, so it's time I nail it down once and for all... I'll be back... -- John