Preliminary note : I need to change return codes. In this page, you will see :
Tot | : | 255 | | |
|
OK | : | 40 | ( | 15.7% | )
|
Err | : | 215 | ( | 84.3% | )
|
- Intervals [0x01,0x13] and [0x41,0x54] are valid (see details below).
- Taking erased long names into account, 0xE5 also is valid.
Specification does not give bounds explicitly (p.27),
but as long as names are limited to 255 characters (p.29),
only intervals [0x01,0x13] and [0x41,0x54] are valid.
I wonder why LAST_LONG_ENTRY mask was chosen to be 0x40,
0x20 would have been OK.
Tot | : | 65536^13
|
OK | : | 4.1x10^62 | ( | 99.2% | )
|
Err | : | 3.4x10^60 | ( | 0.8% | )
|
- No trailing periods or spaces
- Trailing NUL then 0xFFFF padding if space available
- 42 chars invalid inside name : 48 chars invalid in short names (p.24),
plus 0xffff, less + , ; = [ ] . (p.29)
if there is no end of string signature,
last char can be a space or a period :
sum(i=0..11,65 494 ^ i) * 65 492 + 65 494 ^ 13 valid combinations.
Check against the next DIR_Name
Tot | : | 255 x 65 536 ^ 13
|
OK | : | 1.6 x 10^64 | ( | 15.2% | )
|
Err | : | 8.9 x 10^64 | ( | 84.8% | )
|
- No trailing periods
- No leading or trailing spaces
- Trailing NUL then 0xFFFF padding if space available
if LDIR_Ord is 0x01, 1st char can't be a space,
and there is no end of string.
Therefore, 65 493 * 65 494 ^ 12 valid combinations
if LDIR_Ord in [0x02, 0x13], there is no end of string.
Therefore, 65 494 ^ 13 valid combinations
if LDIR_Ord is 0x41, both 1st char can't be a space and an end of string
is present. Therefore
65 492 + 65 493 * sum(i=0..11, 65 494 ^ i) * 65 492 valid combinations
if LDIR_Ord in [0x42, 0x53], there is an end of string.
Therefore, sum(i=0..12, 65 494 ^ i) * 65 492 valid combinations
if LDIR_Ord is 0x54, there are at most 8 characters.
Therefore, sum(i=0..7, 65 494 ^ i) * 65 492 valid combinations
if LDIR_Ord id 0xe5, there is no restriction,
therefore sum(i=0..11, 65 494 ^ i) * 65 492 + 65 494 ^ 13
valid combinations.
Better validation will be achieved with unicode checking vs
short name codepage.
Tot | : | 255 x 65 536 ^ 13 x 4 + 1 x 65 536 ^ 13 x 1
|
OK | : | 1.6 x 10^64 | ( | 3.9% | )
|
W2 | : | 4.7 x 10^64 | ( | 11.4% | )
|
Err | : | 3.5 x 10^65 | ( | 84.8% | )
|
Linux-erased long entries :
sum(i=0..11, 65 494 ^ i) * 65 492 + 65 494 ^ 13 valid entries
Normal long entries :
1.6 x 10^64 OK
3 x 1.6 x 10^64 W2