Saber 酱的抱枕

Fly me to the moon

07/12
2016
软件

windows中文件名长度问题

此文内容作废

windows中文件名长度问题

  1. Google Chrome 51Google Chrome 51Windows 8.1 x64 EditionWindows 8.1 x64 Edition

    其实很讨厌D:\Program Files (x86)\test这种目录下的东西不能直接用QAQ还得改成D:\Progra~\test

    回复
  2. locationiskey
    Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

    问题是,我的测试结果是
    文件夹d:\desktop\2*236个
    d:\2*244个
    文件d:\desktop\2*248个
    d:\*255个

    回复
    1. saber 文章作者
      Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

      我测试的是
      F:\ 根目录可以使用255个字符
      F:\desktop\ 这里面只能使用248个
      按说下面应该是247个啊

      回复
      1. locationiskey
        Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

        就是这样的。那个链接里也提到根目录和别的不一样

        回复
        1. saber 文章作者
          Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

          那就姑且认为在非根目录下可以多写一个字符?(╯°口°)╯(┴—┴

          回复
          1. locationiskey
            Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

            这个东西本就是一个向下兼容的限制,ntfs本身支持超长文件名,只是win不直接开放。适当方式调用api是可以做到的

            回复
    2. saber 文章作者
      Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

      关于在文件夹里可以多写一个长度,会不会有另一种可能,就是路径最后没有的那个斜杠
      如:F:\wamp\www\t
      这个问题……
      话说我在这里回复你你能及时看到吗

      回复
      1. locationiskey
        Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

        算是能吧……
        我考虑过,但是……
        这个只能解释根目录下的,非根目录下的呢

        回复
        1. saber 文章作者
          Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

          路径和文件名合起来是256个字符。我们感觉是257个的时候,就是因为中间多了个斜杠。
          但是,单单说路径,我认为是没有斜杠的。
          例如在php里输出路径最后没有斜杠
          cmd里进入某个目录最后也不需要斜杠
          复制资源管理器地址栏粘贴出来也没有最后的斜杠。
          所以其实最大还是256,这个256建立在路径和文件名分开看的基础上。分开看的时候没有斜杠。

          回复
          1. locationiskey
            Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

            等下d:\desktop\2*248不是1+7+1+248=257么……这个没有最后的/啊

            回复
          1. locationiskey
            Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

            但是desktop后面的/呢
            毕竟路径是叫做d:\desktop\222222......2222啊……我认为你的意思是d:\desktop\222222......2222之后再加一个\

            回复
        2. saber 文章作者
          Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

          d:\desktop
          +
          248个2

          路径末尾没斜杠,文件最后也没斜杠
          文件末尾我为什么要加斜杠,不是有病吗

          回复
          1. locationiskey
            Internet Explorer 11.0Internet Explorer 11.0Windows 7Windows 7

            但是你说的叫做位置+文件名,完整路径需要desktop后面的那个/……比如命令行调用文件就是完整路径;如果是按照位置+文件名……我觉得好奇怪……

            回复
    1. saber 文章作者
      Google Chrome 51Google Chrome 51Windows 7 x64 EditionWindows 7 x64 Edition

      次饭好早←_←
      如果路径的f:\算一个字符,剩下的还有8个字符,那么合起来是9个,多了一个

      回复
TOP
    显示公告
    聊      天
    吃 零 食
    博客后台
    生存时间
    关闭春菜
    X
    召唤春菜