Files per sub-directory

Posted on 2006-04-08
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.

Question by:patrickab
    LVL 9

    Assisted Solution

    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:

    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 :)
    LVL 44

    Assisted Solution

    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.  
    LVL 25

    Accepted Solution

    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,
    LVL 45

    Author Comment

    Thank you all for you contributions - most helpful.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Sometimes the best way to deal with an infected computer is to boot from external media and run your tools from there.  The reason you may wish to do this really depends on the infection.  Some malware is so recalcitrant that no matter what you do i…
    How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
    This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
    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…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now