gpt4 book ai didi

java - Windows 替代 CLI,没有文件名字符限制

转载 作者:行者123 更新时间:2023-12-02 03:26:45 25 4
gpt4 key购买 nike

尝试在项目上运行 mvn clean install -Dfull 返回文件名或扩展名太长错误。我被告知您可以在 Windows 上安装没有限制的替代 CLI。

任何人都可以引导我到哪里可以安装这个,还是我的理解不正确?

谢谢。

更新:我使用的是 Windows 7 64 位

最佳答案

如果您碰巧运行的是刚刚发布的 Windows 10 v1607,则可以通过注册表或策略在全局范围内启用长达(大约)32 KB 的路径,或者通过 list 为每个应用程序启用路径。

来自刚刚更新的引用 Naming Files, Paths, and Namespaces :

Tip   Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior.

A registry key allows you to enable or disable the new long path behavior. To enable long path behavior set the registry key at HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled (Type: REG_DWORD). The key's value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (list follows). The registry key will not be reloaded during the lifetime of the process. In order for all apps on the system to recognize the value of the key, a reboot might be required because some processes may have started before the key was set.

The registry key can also be controlled via Group Policy at Computer Configuration > Administrative Templates > System > Filesystem > Enable NTFS long paths.

You can also enable the new long path behavior per app via the manifest [...]

当然,这可以在系统(API)级别支持>260个字符长的路径。如果应用程序对最大路径长度有自己的硬编码假设(例如 wchar_t mypath[_MAX_PATH];),那么再多的系统级支持也无法神奇地使该特定应用程序使用更长的路径。

关于java - Windows 替代 CLI,没有文件名字符限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38749582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com