WinRT 中的 MAX_PATH
我知道 WinRT 中的文件系统访问是不同的(读:隔离),但我很好奇我们是否仍然需要担心 MAX_PATH,或者是否已经避免了该限制?
I know that file system access in WinRT is different (read: isolated), but I'm curious if we still have to worry about MAX_PATH, or has that restriction been avoided?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,MAX_PATH 限制尚未解除 - 如果您将长于 MAX_PATH 的路径传递给接受路径的 Windows 运行时 API,它仍然可能会失败。但 MAX_PATH 不太可能相关,因为 Windows 运行时 API 通常对字符串进行操作,而不是对字符缓冲区进行操作。
此外,由于 Metro 风格应用程序通常限制在它们访问的目录中,因此不太可能遇到深层路径。
No, the MAX_PATH restrictions haven't been lifted - if you pass a path longer than MAX_PATH to a windows runtime API which accepts a path, it is still possible it will fail. But MAX_PATH is far less likely to be relevant, since windows runtime APIs typically operate on strings, and not on buffers of characters.
In addition, since metro style apps are typically restricted in the directories that they access, deep paths are less likely to be encountered.