[comp.os.msdos.misc] Limit on number of files per directory

duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) (07/27/90)

Is there a limit on files in DOS?  Is there a certain number that I should
start worrying if I go above?

I am having problems in WORD 5.0 accessing the disk drive in the root
directory where there are 180+ files. (Someone elses machine)

Could the number of files be a problem

-Joe

jm21@prism.gatech.EDU (Jim Marks) (07/27/90)

In article <19528@orstcs.CS.ORST.EDU> duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) writes:
>Is there a limit on files in DOS?  Is there a certain number that I should
>start worrying if I go above?
>
...
>
>Could the number of files be a problem
>

I had this problem once upon a time.  I believe it is more of a problem for
floppy drives, but can be for hard drives also.

According to my DOS manual (Dell 3.30), you can have up to 112 files in the
root directory of a 5-1/4 DSDD disk or 224 entries for a 3-1/2 HD (1.44M)
disk.  It doesn't say how many for a hard drive.

I'm pretty sure that this is because of how the disk is formatted.  The
root directory is in a fixed location on the disk, and its size is determined
when you format.  Subdirectories, on the other hand, are treated like files
and can be anywhere; in particular, they can be extended, so that you aren't
limited on how many files you can have in them.

>-Joe


-- 
Jim Marks   		   | Georgia Tech Research Institute
Compuserve: 72310,2410     | Concepts Analysis Laboratory
Internet:   jm21@prism.gatech.edu -or- jmarks@gtri01.gatech.edu

austing@Apple.COM (Glenn L. Austin) (07/27/90)

jm21@prism.gatech.EDU (Jim Marks) writes:

>In article <19528@orstcs.CS.ORST.EDU> duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) writes:
>>Is there a limit on files in DOS?  Is there a certain number that I should
>>start worrying if I go above?
>>
>...
>>
>>Could the number of files be a problem
>>

>According to my DOS manual (Dell 3.30), you can have up to 112 files in the
>root directory of a 5-1/4 DSDD disk or 224 entries for a 3-1/2 HD (1.44M)
>disk.  It doesn't say how many for a hard drive.

The number for most hard drives (prior to 4.0) was 512 directory entries.
Don't forget that the Label uses one directory entry, two are used for the
low-level DOS (xxxIO, xxxDOS), one is needed for CONFIG.SYS, one is needed
for COMMAND.COM (unless you specify otherwise in CONFIG.SYS), and one is
used for each subdirectory in the root directory.

-- 
-----------------------------------------------------------------------------
| Glenn L. Austin               | "Turn too soon, run out of room,          | 
| Auto Racing Enthusiast and    |   Turn too late, much better fate"        |
| Communications Toolbox Hacker |   - Jim Russell Racing School Instructors |
| Apple Computer, Inc.          | "Drive slower, race faster" - D. Waltrip  | 
| Internet:   austing@apple.com |-------------------------------------------|
| AppleLink:  AUSTIN.GLENN      | All opinions stated above are mine --     |
| Bellnet:    (408) 974-0876    |                who else would want them?  |
-----------------------------------------------------------------------------

mkallas@digi.lonestar.org (mark kallas) (07/27/90)

In article <19528@orstcs.CS.ORST.EDU> duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) writes:
>Is there a limit on files in DOS?  Is there a certain number that I should
>start worrying if I go above?

The limit is for the root directory only. There is no limit for the number of
files in a sub-directory.

Common Root Directory Limits
Single Sided Floppy Disk (160K)		64  files
Double Sided Double Density (360K)	112 files
Double Sided High Density (1.2M)	224 files
Fixed Disk (any size)			512 files

(sorry I didn't see info on 720k or 1.44M micro floppies)

Reference - _PC_Magazine_DOS_Power_Tools by Paul Somerson 
Chapter 3 - Hard Disks Made Easy, Directory Limits page 77-- 
UUCP    : texbell!digi!mkallas
Internet: mkallas@digi.lonestar.org

grantk@manta.NOSC.MIL (Kelly J. Grant) (07/28/90)

>>Is there a limit on files in DOS?  Is there a certain number that I should
>
>According to my DOS manual (Dell 3.30), you can have up to 112 files in the
>root directory of a 5-1/4 DSDD disk or 224 entries for a 3-1/2 HD (1.44M)
>disk.  It doesn't say how many for a hard drive.
>

<Good technical advice removed :-) >

As hackers and/or power users, I feel it is our job to educate people
on how to best use their computers.  They should be shown how to 
make subdirectories and how to easily move back and forth between them.
Use the filing cabinent analogy, and you will have no trouble getting
them to understand.  Especially since most new software deals well with
multiple directories, there should be little pain involved for the user.

You just may breed another power user !  :-)

Just my $.02 worth

Kelly


-- 
Kelly Grant        grantk@manta.nosc.mil   (619) 225-8401
Computer Sciences Corp          ^^^^^^^^ Important: manta.UUCP won't get to me
4045 Hancock Street      "If you are given lemons.....see if you can trade for
San Diego, CA 92110       chocolate" - me

young@ut-emx.UUCP (Young) (07/28/90)

Limit on Number of Directory Entries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Each directory entry (usually file) requires
   32 bytes for sttributes and specifications.
   ^^^^^^^^
2. One sector usually provides 512 Kbytes.
                               ^^^^^^^^^^
3. Each disk type uses different number of sectors
   for directory entry information. High-density
   disks use _14 sectors_ (7168 bytes), double-sided
   double-density disks use _7 sectors_ (3584 bytes),
   and single-sided double-density disks use
   _4 sectors_ (2048 bytes), regardless the size
   of disk (e.g. 5.25" or 3.5").
   Note: In case of double-density 5.25" disks,
         both 9 and 8 sector formats use the same
         amount of sectors for directory entry
         information.

4. Now, one can easily :-) calculate the maximum number
   of directory entries:

   DSSD (160 or 180 Kbytes)    -  64 entries
   DSDD (320, 360, 720 Kbytes) - 112 entries
   DSHD (1.2 or 1.4 Mbytes)    - 224 entries.

5. As Mr. Glenn L. Austin @ Apple Comp. Inc.
   (austing@apple.com) posted on 7/26/90,
   most hard disks support(ed) up to 512 directory
   entires. But, under a DOS 4.xx, the number
   may be different. In addition, the number is
   dependent on the physical design of a hard disk.

6. Finally, let me quote Mr. Glenn L. Austin's words:

   > Don't forget that the Label uses one directory entry,
   > two are used for the low-level DOS (xxxIO, xxxDOS),
   > one is needed for CONFIG.SYS, one is needed for
   > COMMAND.COM (unless you specify otherwise in CONFIG.SYS),
   > and one is used for each subdirectory in the root directory.

   These are important things that are frequently overlooked.


Young @ the University of Texas at Austin

young@emx.utexas.edu (Arpa/Internet)
BGBG767@UTAIVC (Bitnet)

dold@mitisft.Convergent.COM (Clarence Dold) (07/28/90)

in article <19528@orstcs.CS.ORST.EDU>, duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) says:

> Is there a limit on files in DOS?  Is there a certain number that I should
> start worrying if I go above?

Along with the hard limits that other posters mention, there is also the
issue of performance.  You mention 'trouble' not failure.
There is a certain number of files, and the number is exact, although I can't
recall what or why, where MSDOS access almost dies.

My wife had ~300 files in one directory, which I split into 10 directories.
The difference was astounding.  I originally thought it was file fragmentation,
but it was directory size.  The system still worked with the outsize directory,
it just wasn't much fun.

Some other poster provided the exact number, along with the reason, and I've
forgotten both.

-- 
---
Clarence A Dold - dold@tsmiti.Convergent.COM            (408) 435-5293
               ...pyramid!ctnews!tsmiti!dold        FAX (408) 435-3105
               P.O.Box 6685, San Jose, CA 95150-6685         MS#10-007