?
Solved

Files per sub-directory

Posted on 2006-04-08
4
Medium Priority
?
1,142 Views
Last Modified: 2007-12-19
Evening Experts,

I am using WinXP and NTFS. Please let me know the maximum number of files I can have in a subdirectory. So far I have 1150 in one sub-d occupying 126Mb, I just want know if there is a limit.

Patrick
0
Comment
Question by:patrickab
4 Comments
 
LVL 9

Assisted Solution

by:sda100
sda100 earned 400 total points
ID: 16408715
The maximum number of files in each directory is governed by the file system rather than the OS.

You can find a lot of info here:
http://www.pcguide.com/ref/hdd/file/fatRoot-c.html

Essentially, there is no limit for FAT32/NTFS, but from experience as soon as you get up to the 100,000 mark, Windows explorer starts to die when trying to open all the files to read the summary data and such.  In this case, use a command window.

Steve :)
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 400 total points
ID: 16409864
The only significant limit is in the ROOT directory, C:\, so you want to keep extraneous files out of there, and leave those entires for subdirectories under the root.  Otherwise, you can have upwards of 10,000, but this is not efficient, takes too long to sort the FAT.  If you can keep the files in any directory to under 500, that is the best optimization of the files system, whether NTFS or others.  
0
 
LVL 25

Accepted Solution

by:
kode99 earned 400 total points
ID: 16410277
There is no limit beyond the actual limit of total files a NTFS volume can hold,  which you will never hit due to hardware limitations.  Up over 4 billion files - 2^32 less one file.

In practice,  as mentioned,  browsing a directory with massive numbers of files can be quite frustrating as there will be a delay as the explorer scans the directory and displays the files.  So long so that it will look like it has crashed if there are enough files.  If you need to browse it over a network this problem will be magnified.

I do find that between 5 and 10 thousand is likely going to be about as much as you want to put into a directory that is browsed.  If accessed over a network probably half that maybe less.  It does depend on your hardware, snappy systems with faster drives do better.

If you are not browsing/scanning there seems to be no real issues.  I have an application that deals with hundreds of thousands of files and it was fine to put them all in a single directory - as long as all access was done directly without the need to scan the directory.

It is usually easier to organize files in smaller quantities with meaningful directory names so humans can find things faster.

You can check out the specs for NTFS from here if you are interested,
http://technet2.microsoft.com/WindowsServer/en/Library/81cc8a8a-bd32-4786-a849-03245d68d8e41033.mspx
0
 
LVL 45

Author Comment

by:patrickab
ID: 16410539
Thank you all for you contributions - most helpful.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
A look at what happened in the Verizon cloud breach.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question