Max # of Files in a Directory?

Dan Nelson dnelson at
Thu Sep 2 15:58:53 PDT 2004

In the last episode (Sep 02), Danny MacMillan said:
> I googled for this but I couldn't find an answer.
> What is the largest number of files that can exist in a single
> directory in FreeBSD?  I ask because I'm using courier-imap using a
> Maildir mailbox and I started seeing all kinds of errors when trying
> to copy more than 16383 messages into one of my folders there.  I'm
> retrieving mail from a

There's a limit of 16384 subdirectories in a single directory (due to
the fact that each subdir has a .. file that's linked to the parent),
but there's no real limit on the number of file.  Try truss'ing the
imap process and see exactly what syscalls are failing.

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list