Operating System - HP-UX
1834839 Members
2895 Online
110070 Solutions
New Discussion

If there are a limitation of the file numbers in a directory?

 
SOLVED
Go to solution
David Shao
Advisor

If there are a limitation of the file numbers in a directory?

If the answer is yes,How to set this limitation?
David Shao
6 REPLIES 6
Printaporn_1
Esteemed Contributor

Re: If there are a limitation of the file numbers in a directory?

Hi David,

see man newfs_hfs there is option -i number_of_bytes_per_inode
decrease this value will increase inode for file system which need to keep many small files.
enjoy any little thing in my life
S.K. Chan
Honored Contributor

Re: If there are a limitation of the file numbers in a directory?

Recent discussion on similar topic..

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbacd91ccb36bd611abdb0090277

Hope it helps ..
steven Burgess_2
Honored Contributor

Re: If there are a limitation of the file numbers in a directory?

Hi

And another one

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xcd745220af9bd5118ff10090279cd0f9,00.html

Regards

Steve
take your time and think things through
S.K. Chan
Honored Contributor

Re: If there are a limitation of the file numbers in a directory?

Systeemingenieurs Infoc
Valued Contributor

Re: If there are a limitation of the file numbers in a directory?

The amount of direct subdirectories under one directory is limited :
grep LINK_MAX /usr/include/limits.h
=> 32767

I think it's good to know (we learned it the hard way !).

So if you want to limit the number of files
in one directory by branching, branch fast
enough (eg 0000/0000/0000/0001.txt!)

Using this algorithm, we're managing a small
20.000.000 files.

Hein Coulier
A Life ? Cool ! Where can I download one of those from ?
Klaus Crusius
Trusted Contributor
Solution

Re: If there are a limitation of the file numbers in a directory?

Hi,

have more than (say) 2000 files directly in one directory will produce considerable performance problems, when accessing this directory. I experienced this on a productive environment, when a outbreak process had created thousands of /tmp-files.
A innocent command like "rm *.old" might not be executed, because the shell command line expansing produces more the 20k.

Thanks, Klaus
There is a live before death!