[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How many files can be put in one directory?



On Thu, Jun 20, 2002 at 08:46:42PM +0900, Taegil Noh wrote:

| File System is one matter, and shell environment is another.
| While ext2/3 and resistfs will surely contain more than
| million files in a directory, (or anywhere anyhow)
| Many shells like bash and csh won't process them
| cleary.

What happens is that the shell tries to expand the wildcard, and that
expansion exceeds the limit on length of a command line.  If you have
a thousand files with only 2 characters in their name, that would
yield a 3k command line, which I think is within the limit (but
haven't tested).  I think that limit is a kernel one because bash
(cygwin) on windows gets cut off MUCH earlier than bash on linux does.
I discovered that while using  `find . <...>`  in the build process of
a certain library.

| Keep it short list. by the way, wasn't that what the
| concepts of 'directory' was for? :]

Directories are namespaces.  I don't think they were invented to keep
the file list short, just to prevent polluting a single global
namespace :-).  (I could be wrong, though)
 
-D

-- 

 "Piracy is not a technological issue. It's a behavior issue."   
                                                       --Steve Jobs
 
http://dman.ddts.net/~dman/

Attachment: pgpskRepC9mjD.pgp
Description: PGP signature


Reply to: