Date: Mon, 27 Jul 2009 09:03:43 -0400 From: John Almberg <jalmberg@identry.com> To: Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: freebsd-questions@freebsd.org Subject: Re: limit to number of files seen by ls? Message-ID: <8AF593F8-DA94-4C54-89E2-155988886331@identry.com> In-Reply-To: <200907261109.44586.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> References: <20090725222918.AC51DB7E0@kev.msw.wpafb.af.mil> <200907260045.12045.mel.flynn%2Bfbsd.questions@mailing.thruhere.net> <8A69BBD9-5F3C-44B8-96C0-586C1B5A386F@identry.com> <200907261109.44586.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8AF593F8-DA94-4C54-89E2-155988886331>