关于长短文件名.doc
文本预览下载声明
短文件名是dos+fat12/fat16时代的产物,命名规则为8.3
8是指文件名或目录名的主体部分小于等于8个字节
3是指文件名或目录名的主体部分小于等于3个字节
另外其中不能包括空格等非法字符
win95+fat32已经支持长文件名,但是同时还是强制使用为长文件名提供8.3短文件名
nt32+ntfs变为可选
ntfs支持unicode文件名,最长255个utf16
长短文件转换的规则,去看msdn
贴一个关于长短转换方法的说明
The?technique?chosen?to?auto-generate?short?names?from?long?names?is?modeled?after?Windows?NT.??Auto-generated?short?names?are?composed?of?the?basis-name?and?an?optional?numeric-tail.??The?Basis-Name?Generation?Algorithm??The?basis-name?generation?algorithm?is?outlined?below.??This?is?a?sample?algorithm?and?serves?to?illustrate?how?short?names?can?be?auto-generated?from?long?names.?An?implementation?should?follow?this?basic?sequence?of?steps.??1.?The?UNICODE?name?passed?to?the?file?system?is?converted?to?upper?case.?2.?The?upper?cased?UNICODE?name?is?converted?to?OEM.?if??(the?uppercased?UNICODE?glyph?does?not?exist?as?an?OEM?glyph?in?the?OEM?code?page)??or?(the?OEM?glyph?is?invalid?in?an?8.3?name)?{??Replace?the?glyph?to?an?OEM?_?(underscore)?character.??Set?a?lossy?conversion?flag.?}?3.?Strip?all?leading?and?embedded?spaces?from?the?long?name.?4.?Strip?all?leading?periods?from?the?long?name.?5.?While??(not?at?end?of?the?long?name)??and?(char?is?not?a?period)??and?(total?chars?copied??8)?{??Copy?characters?into?primary?portion?of?the?basis?name?}?6.?Insert?a?dot?at?the?end?of?the?primary?components?of?the?basis-name?iff?the?basis?name?has?an?extension?after?the?last?period?in?the?name.?7.?Scan?for?the?last?embedded?period?in?the?long?name.?If?(the?last?embedded?period?was?found)?{??While??(not?at?end?of?the?long?name)???and?(total?chars?copied??3)??{???Copy?characters?into?extension?portion?of?the?basis?name??}?}?Proceed?to?numeric-tail?generation.??The?Numeric-Tail?Generation?Algorithm???If???(a?lossy?conversion?was?not?flagged)??and?(the?long?name?fits?within?the?8.3?naming?conventions)??and?(the?basis-name?does?not?collide?with?any?existing?short?name)?{??The?short?name?is?only?the?basis-name?without?the
显示全部