User Tip #69: Maximum files in root directory

Hits: Failed to execute CGI : Win32 Error Code = 3


As a support person, I have had several calls of the type where Joe or SallySue couldn't save their precious document that had been worked on all day. Out of disk space? NO, there is plenty of disk space on the PC. Or is there? Some people are careless about where applications store documents. Instead of forcing the documents into a know location /data directory , they let the docs get written into any random location including the root (or windows term, root folder). Some people do this routinely. They can find it easily in the root.

Unfortunaly the root is the ONLY directory(folder) that has a set limit on the number of files it can hold. The root is actually a table with pointers to the actual storage locations. There is no limit for the number of entries in a subdirectory. OK. OK. What is the limit? 224 used to be the magic number which is the number of entries available in the File Allocation Table (FAT) for DOS. Later this was increased to 512 for 16bit FAT and there is no limit in FAT32. NTFS also has no limit. Long file names take more than one entry. So if one is using long file names and storing them in the root directory, you will hit the 512 max very quickly even though there are significantly less than 512 entries shown in the directory listing. Just depends on how long the long file names you use.

Rule of thumb - store your documents in a subdirectory. Even though NTFS and FAT32 do not have the limitation, do you need the hassle of wading through a mass of documents stored in the root. Additionally when you get beyond 100 entries, lookup begins to bog down the system. I have seen folders (subdirectories) with thousands of files - DON'T. Things start getting real slow on fast PCs. Simply dividing the files into folders with no more than 100 docs will make the gasping PC magically faster in browsing.