[comp.sys.mac.programmer] HFS directory allocation?

rcook@eagle.wesleyan.edu (ME:MINT.INIT) (02/16/91)

A few weeks ago I remember reading somewhere (I believe it was Inside
Appletalk, 2nd edition) that there is a limit to the number of directories you
can create on any given volume.  Ever after, I have cringed every time I make a
new folder or destroy an old one.  I also heard that the directory numbers of
deleted directories cannot be reused, which is why I get worried that I will
run out of directories.

I suppose I should not be so concerned because HFS uses 16 bit numbers for its
directories, so 30000 folders is an awful lot to chug through.  I just want to
hear the story from someone who knows.  Thanks in advance.

------------------------
Randall Cook
rcook@eagle.wesleyan.edu
------------------------

andyp@treehouse.UUCP (Andy Peterman) (02/17/91)

In article <1991Feb15.200946.38986@eagle.wesleyan.edu> rcook@eagle.wesleyan.edu (ME:MINT.INIT) writes:
>A few weeks ago I remember reading somewhere (I believe it was Inside
>Appletalk, 2nd edition) that there is a limit to the number of directories you
>can create on any given volume. 
> ...
>I suppose I should not be so concerned because HFS uses 16 bit numbers for its
>directories, so 30000 folders is an awful lot to chug through.  I just want to
>hear the story from someone who knows.  Thanks in advance.

Directories (and files) are given a new 32 bit number every time a new
one is created.  This is reflected in the directory ID number that you
use in most of the HFS File Manager calls.  I had a hard disk which
hadn't been initialized in a LONG time that had directory IDs well above
40000.  It would probably take longer to create more than 100,000 or so
files than most hard disk would last.  I wouldn't worry about it!

-- 
Andy Peterman                       |   Opinions expressed
treehouse!andyp@gvgpsa.gvg.tek.com  | are definitely those of
(916) 273-4569                      |      my employer!

francis@zaphod.uchicago.edu (02/17/91)

In article <809@treehouse.UUCP> andyp@treehouse.UUCP (Andy Peterman) writes:

   Directories (and files) are given a new 32 bit number every time a new
   one is created.  This is reflected in the directory ID number that you
   use in most of the HFS File Manager calls.  I had a hard disk which
   hadn't been initialized in a LONG time that had directory IDs well above
   40000.  It would probably take longer to create more than 100,000 or so
   files than most hard disk would last.  I wouldn't worry about it!

Not 100,000--4,294,967,296.  At one directory per second (computer
could probaby go faster, but not within the Finder interface), that's
about 134 years.  DEFINITELY longer than your HD will last.

--
/=============================================================================\
| Francis Stracke		| My opinions are my own.  I don't steal them.|
| Department of Mathematics	|=============================================|
| University of Chicago		| Until you stalk and overrun,	     	      |
| francis@zaphod.uchicago.edu	|  you can't devour anyone. -- Hobbes 	      |
\=============================================================================/