unix question: files per directory

Larry McVoy lm at snafu.Sun.COM
Sun Apr 16 13:05:32 AEST 1989


In article <5980047 at hpfcdc.HP.COM> rml at 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 at sun.com



More information about the Comp.unix.wizards mailing list