Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!sun!snafu!lm From: lm@snafu.Sun.COM (Larry McVoy) Newsgroups: comp.unix.wizards Subject: Re: unix question: files per directory Message-ID: <99256@sun.Eng.Sun.COM> Date: 16 Apr 89 03:05:32 GMT References: <24110@beta.lanl.gov> <5980047@hpfcdc.HP.COM> Sender: news@sun.Eng.Sun.COM Reply-To: lm@sun.UUCP (Larry McVoy) Organization: Sun Microsystems, Mountain View Lines: 19 In article <5980047@hpfcdc.HP.COM> rml@hpfcdc.HP.COM (Bob Lenk) writes: >>>How many files can there be in a single UNIX directory .... >> return pathconf(dirpath, _PC_LINK_MAX); > >This will tell you how many links you can make *to* dirpath, not how >many links you can make *in* dirpath. There might be a tangential >relationship to the number of subdirectories you can make in dirpath, >but don't even count on that. This simply isn't true. The pathconf LINK_MAX has different meanings depending on the path. If you ask about anything but a directory you get the number of links you may make to the file (MAXLINKS or whatever your kernel calls it). If you ask about a directory the answer must be the number of entries allowed in the specified directory, *not* the number of links allowed to the directory. This information was obtained (by me) from the person responsible for that page of POSIX and he has assured me that this is the intent. POSIX kernel people take note. Larry McVoy, Lachman Associates. ...!sun!lm or lm@sun.com