What is the max number of files that can be kept in a single folder, on Win7/Mac OS X/Ubuntu Filesystems?
I'm wondering about what is the maximum number of files that can be present in a single folder, in the file systems used by all the pre开发者_如何学Govalent OSes mentioned. I need this information in order to decide the lowest common denominator, so that the folder I'm building can be opened and accessed in any OS.
In Windows (assuming NTFS): 4,294,967,295 files
In Linux (assuming ext4): also 4 billion files (but it can be less with some custom inode tables)
In Mac OS X (assuming HFS): 2.1 billion
But I have put around 65000 files into a single directory and I have to say just loading the file list can kill an average PC.
This depends on the filesystem. The lowest common denominator is likely FAT32 which only allows 65,534 files in a directory.
These are the numbers I could find:
- FAT16 (old format, can be ignored): 512
- FAT32 (still used a lot, especially on external media): 65,534
- NTFS: 4,294,967,295
- ext2/ext3 (Linux): Depends on configuration at format time, up to 4,294,967,295
- HFS+ (Mac): "up to 2.1 billion"
Most modern OSes have no upper limit, or a very high upper limit. However, performance usually begins to degrade when you have something on the order of 10,000 files; it's a good idea to break your directory into multiple subdirectories before this point.
From what I know for Windows 7, you can have unlimited amount of files per directory. BUT the more files you have on a volume, the worse the performance will be for that volume.
精彩评论