A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2004-02-28 08:54 PM

Registered: 2004-02-27
Posts: 12

Re: how many subdirectories inside directories

Dear friends,

I am developing a Sync utility for simputers on linux platform. I want to know that is there any limit of the number of directories(sub directories) that can be created inside a directory?




#2 2004-02-28 11:18 PM

From: Boston, MA
Registered: 2002-06-12
Posts: 3,839

Re: how many subdirectories inside directories

I actually ran into this once on an old RH6.2 system...  There, the
limit was about 32K subdirs...  Technically, I believe the limit is on
number of hard links, and because "st_nlink" is a 16-bit value...
But, of course, every subdir in a dir creates another hard link to the
parent dir (".."), increasing the link count...  I believe some
filesystems kluge around this issue by simply setting some bogus
link count (either the max, or something like 1, which should never
occur on any directory) in the case that you have too many subdirs,
but they still allow them to exist, anyway...  However, ext2 at least
didn't used to allow that; once you hit the hard link limit, it just refused
to create more subdirs at all...  That may have been changed in
newer kernels, and/or with ext3...  I'm not sure, though...


Board footer

Powered by FluxBB