From: Frank L. <fra...@go...> - 2011-01-27 13:02:15
|
2011/1/27 HAT <ha...@fa...>: > Why 765? > > ------------------------------------------------------------- > U+0 - U+7F (ASCII) > > UTF8-MAC: 1 [character] = 1 [byte] > UTF16-MAC: 1 [character] = 1 [codepoint] > > AFP / HFS+ > = UTF8-MAC / UTF16-MAC > = 1 [byte] / 1 [codepoint] > = 1 [byte/codepoint] > > ------------------------------------------------------------- > U+80 - U+7FF (non-ASCII Alphabet, etc) > > UTF8-MAC: 1 [character] = 2 [byte] > UTF16-MAC: 1 [character] = 1 [codepoint] > > AFP / HFS+ > = UTF8-MAC / UTF16-MAC > = 2 [byte] / 1 [codepoint] > = 2 [byte/codepoint] > > ------------------------------------------------------------- > U+800 - U+FFFF (CJK, etc) > > UTF8-MAC: 1 [character] = 3 [byte] > UTF16-MAC: 1 [character] = 1 [codepoint] > > AFP / HFS+ > = UTF8-MAC / UTF16-MAC > = 3 [byte] / 1 [codepoint] > = 3 [byte/codepoint] > > ------------------------------------------------------------- > U+10000 - U+10FFFF (Surrogate Pair) > > UTF8-MAC: 1 [character] = 4 [byte] > UTF16-MAC: 1 [character] = 2 [codepoint] > > AFP / HFS+ > = UTF8-MAC / UTF16-MAC > = 4 [byte] / 2 [codepoint] > = 2 [byte/codepoint] > > ------------------------------------------------------------- > > Therefore, > Max 3 [byte/codepoint] > > ------------------------------------------------------------- > HFS+'s max filename is 255 [codepoint]. > > 255 [codepoint] * 3 [byte/codepoint] = 765 [byte] > > Max is 765 [byte] on AFP. Only because the most used (ok, ok, in fact the only real one, but nevertheless...) AFP clients local filesystem (HFS+) is limited to 255 codepoints, doesn't mean afpd should _impose_ this limit. Instead, as already said, afpd should just accept any length up to AFP maxlen (65k afair), apply MAXPATHLEN (which is needed due to our static buffers eg), use the resulting name in OS calls and pass error back to the client once afpd hits PATH_MAX server side. -f |