Xref: utzoo comp.unix.wizards:15502 comp.unix.questions:12792 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!snafu!lm From: lm@snafu.Sun.COM (Larry McVoy) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: unix question: files per directory Keywords: how many can there be? Message-ID: <98470@sun.Eng.Sun.COM> Date: 11 Apr 89 19:43:49 GMT References: <24110@beta.lanl.gov> <16839@mimsy.UUCP> Sender: news@sun.Eng.Sun.COM Reply-To: lm@sun.UUCP (Larry McVoy) Distribution: na Organization: Sun Microsystems, Mountain View Lines: 20 >In article <24110@beta.lanl.gov> dxxb@beta.lanl.gov (David W. Barts) writes: >>How many files can there be in a single UNIX directory .... >>I realize that as directories get bigger, they slow down, but >>how much? Just what IS the maximum directory size? If you are on a POSIX system, try this #include dirsentries(dirpath) char *dirpath; { return pathconf(dirpath, _PC_LINK_MAX); } Unfortunately, on systems that allow entries up to the file size, pathconf will almost certainly return -1 (indicating "infinity"). But machines with a hard limit should give you that limit. Larry McVoy, Lachman Associates. ...!sun!lm or lm@sun.com