Unix Programming - Limit on number of files in a directory

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2005 > Limit on number of files in a directory





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Limit on number of files in a directory
Michael McGarry

2005-11-23, 5:54 pm

Hi,

I have a directory with a huge number of files. I am running a program
that tries to create a new file for writing and it can't. Is there some
limit on the number of files in a directory. I am using Mac OS X which
is a Unix derivative.

Any help is greatly appreciated,

Michael

Gordon Burditt

2005-11-23, 5:54 pm

>I have a directory with a huge number of files. I am running a program

What's "huge"? 10 million? My MacOS 60G disk ended up with
about 11 million inodes with the default setup.

>that tries to create a new file for writing and it can't. Is there some
>limit on the number of files in a directory. I am using Mac OS X which
>is a Unix derivative.


Typical UNIX filesystems generally have two limits: disk space and
inodes. "df -i" to see if you're getting close on either. These
are filesystem, not directory, limits, but hitting them might look
like a directory limit.

What error message are you getting? "Out of space" serves for both
disk space and inode limits.

There might also be a limit on the number of (hard) links a file
can have, which also serves as a limit on the number of subdirectories
(the link count of a directory is 2 + number of subdirectories) but
that's usually so high that violating it is difficult (16-bit
unsigned integer, max 65535).

I'm not sure whether MacOS is any different in this regard.

Gordon L. Burditt
Pascal Bourguignon

2005-11-23, 5:54 pm

gordonb.wqanv@burditt.org (Gordon Burditt) writes:

> I'm not sure whether MacOS is any different in this regard.


MacOSX is very different in this regard, since it doesn't use by
default a unix file system, but HFS+, an Apple specific contraption
which is, well, different.
Better search references on http://developer.apple.com/



--
__Pascal Bourguignon__ http://www.informatimago.com/
Cats meow out of angst
"Thumbs! If only we had thumbs!
We could break so much!"
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com