[转]windows 短文件名/短路径名规则

Posted FryFish

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[转]windows 短文件名/短路径名规则相关的知识,希望对你有一定的参考价值。

How Windows Generates 8.3 File Names from Long File Names

 

Windows generates short file names from long file names in the following manner: 
  • Windows deletes any invalid characters and spaces from the file name. Invalid characters include:
    . " / \\ [ ] : ; = ,
  • Because short file names can contain only one period (.), Windows removes additional periods from the file name if valid, non-space characters follow the final period in the file name. For example, Windows generates the short file name
    Thisis~1.txt
    from the long file name
    This is a really long filename.123.456.789.txt
    Otherwise, Windows ignores the final period and uses the next to the last period. For example, Windows generates the short file name
    Thisis~1.789
    from the long file name
    This is a really long filename.123.456.789.
  • Windows truncates the file name, if necessary, to six characters and appends a tilde (~) and a digit. For example, each unique file name created ends with "~1." Duplicate file names end with "~2," "~3," and so on.
  • Windows truncates the file name extension to three characters or less.
  • Windows translates all characters in the file name and extension to uppercase.
Note that if a folder or file name contains a space, but less than eight characters, Windows still creates a short file name. This behavior may cause problems if you attempt to access such a file or folder over a network. To work around this situation, substitute a valid character, such as an underscore (_), for the space. If you do so, Windows does not create a different short file name 

For example, "Afile~1.doc" is generated from "A file.doc" because the long file name contains a space. 
No short file name is generated from "A_file.doc" because the file name contains less than eight characters and does not contain a space. 
The short file name "Alongf~1.txt" is generated from the long file name "A long filename.txt" because the long file name contains more than eight characters.
 

转自:http://www.cnblogs.com/jiangzhen/p/3957333.html

 

以上是关于[转]windows 短文件名/短路径名规则的主要内容,如果未能解决你的问题,请参考以下文章

yaml语法三大规则

yaml语法三大规则

微信公众号,长链接转短链接,怎么操作

Nodejs+mySql实现长地址转短地址

如何使用短完整路径创建符号链接?

十进制转换为二进制为啥用短除法,即用短除法的原理是啥,为啥要用到短除法?