Re: [OT] files/dir on windoze
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jul 11, 2004
- 589 views
Me wrote: > Irv Mullins wrote: > >> Juergen Luethje wrote: >>> >>> Unfortunately, this error message is not much more specific than >>> Euphoria's error massage. Anyway, there is increasing evidence that this >>> is a general Windows issue, isn't it? But nobody on this list has heard >>> about it before ...? >> >> No, and I haven't been able to find anything via Google, either. >> Granted, not many people are likely to have 17,000 files in any >> one directory (with LFN's). We know the problem does not occur >> with Eu on Linux, so it's presumably not a Eu problem. And it's presumably not a Linux problem, and as Matt pointed out, it's presumably not an NTFS problem, but a FAT issue. We have considered the problem from many sides, and so I googled for "fat lfn limit number entries" (without the double-quotes). Among other pages, I found <http://www.danisoft.com/services/FileSystems.jsp> and I believe there is the formula that I was looking for:
function ceil (object x) -- ceil() is the opposite of floor() return -floor(-x) end function function number_of_occupied_dir_entries (integer lengthOfFileName) return 1 + ceil(lengthOfFileName/13) end function
<snip> > Using Euphoria to create files with names that consist of 81 characters > each, 8192 files per directory are possible on my system. Unfortunately, this statement contains a mistake: The Eu program created 8191 files with names that consisted of 81 characters each. The 8192th file was the program itself. The name of the program did consist of much less than 81 characters (I don't remember -- say 8 characters, when the name was "test.exw"). So the total number of occupied directory entries was:
? 8191 * number_of_occupied_dir_entries(81) + 1 * number_of_occupied_dir_entries( 8) -- prints 65530
One more file with a 81-character name would have resulted in 65538 total entries, which obviously isn't possible. > Using Total Commander to copy files with names that consist of 80 > characters each, 8191 files per directory are possible. In this case, the total number of occupied directory entries was:
? 8191 * number_of_occupied_dir_entries(80) -- prints 65528
One more file with a 80-character name would have resulted in 65536 total entries, which obviously isn't possible. > Doesn't sound logically, but is true. Was not completely true ... >> Does this happen with all versions of Windows, or just some? > > Kat wrote she was using Win 95B, I was using Win 98 (partition with > FAT 32, 7.58 GB total, 5.14 GB free, 4096 bytes per cluster). Elliot, > on what Windows version did you run your test? My current hypothesis is: On several (if not all) Windows FAT systems, there is a maximum of 65535 (biggest unsigned 16-bit integer) entries per directory. The number of entries occupied by a filename depends on its length, and is calculated by the function number_of_occupied_dir_entries() (see above). Regards, Juergen