如何在Windows中创建路径长度大于256的目录 [英] How to create directories in windows with path length greater than 256

查看:518
本文介绍了如何在Windows中创建路径长度大于256的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文件夹路径中有几级目录.当路径超过256时,则无法从中创建子文件夹或文件.有没有机会建立超出此长度的路径. 谁能帮助我.

I have several level of directories in the folder path. when the path exceeds 256, then I could not create a sub-folder or file from it. Is there any chance to build paths more than this length. Can anyone help me out.

推荐答案

实际上,路径字符串的限制为260个字符.目前,底层操作系统可以支持更长的路径名,

In fact the limit on path strings is 260 characters. The underlying OS, these days, can support much longer path names, up to 32,767 characters. In order to name a path with a long name you need to use the magic \\?\ prefix, and use the Unicode version of the API.

但是,许多工具不支持这么长的名称.这种工具的经典示例是资源管理器,它不允许您创建名称长度超过260个字符的对象.因此,我强烈建议您避免创建这么长的名称-从长远来看,这样做可以为您省去很多麻烦.

However, many tools don't support such long names. A classic example of such a tool is Explorer which won't let you create objects with names longer than 260 characters. Because of this I strongly advise you to avoid creating such long names—doing so will save you much heartache in the long run.

这篇关于如何在Windows中创建路径长度大于256的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆