DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: laidabin
今日帖子: 1
在线用户: 3
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 lsuper (lsuper) ★☆☆☆☆ -
盒子活跃会员
2018/5/27 0:34:27
标题:
突然发现,微软在 Win10 1607 上把 MAX_PATH 整没了 ~ 浏览:1591
加入我的收藏
楼主: 颠覆 Windows 程序员多年的认知啊:

https://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

不过,巨硬也是一贯的兼容 ...

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:
XML

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings";>
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>

These are the directory management functions that no longer have MAX_PATH restrictions if you opt-in to long path behavior: CreateDirectoryW, CreateDirectoryExW GetCurrentDirectoryW RemoveDirectoryW SetCurrentDirectoryW.

These are the file management functions that no longer have MAX_PATH restrictions if you opt-in to long path behavior: CopyFileW, CopyFile2, CopyFileExW, CreateFileW, CreateFile2, CreateHardLinkW, CreateSymbolicLinkW, DeleteFileW, FindFirstFileW, FindFirstFileExW, FindNextFileW, GetFileAttributesW, GetFileAttributesExW, SetFileAttributesW, GetFullPathNameW, GetLongPathNameW, MoveFileW, MoveFileExW, MoveFileWithProgressW, ReplaceFileW, SearchPathW, FindFirstFileNameW, FindNextFileNameW, FindFirstStreamW, FindNextStreamW, GetCompressedFileSizeW, GetFinalPathNameByHandleW.
----------------------------------------------
-
作者:
男 nevergrief (孤独骑士) ★☆☆☆☆ -
盒子活跃会员
2018/5/27 0:55:07
1楼: windows下一直使用\\?\妥妥的。倒是Linux也有1024的限制,目前不知道该怎么办。Mac不清楚有没有这个问题,应该也是相同的。我说的是程序级的解决问题,而不是修改系统设置。
----------------------------------------------
只有偏执狂才能生存!
作者:
男 keymark (嬲) ▲▲▲△△ -
普通会员
2018/5/27 11:16:25
2楼: win7没事吗?不觉得啊
我在linux下 复制文件进NTFS  然后上win7复制到 主硬盘.提示路径太长.
----------------------------------------------
[alias]  co = clone --recurse-submodules  up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
男 magiewang (magiewang) ▲▲▲△△ -
普通会员
2018/5/27 17:26:33
3楼: 楼上的一定没看1楼的解释,直接加\\?\PATH
是没有问题的。
----------------------------------------------
-
作者:
男 scarlette (Scarlette) ★☆☆☆☆ -
普通会员
2018/5/27 21:34:42
4楼: 咦?今天才知道还有个CreateFile2函数……
----------------------------------------------
-
作者:
男 bahamut8348 (leonna) ★☆☆☆☆ -
普通会员
2018/5/28 8:34:44
5楼: 然而,windows就算不在限制260个字符最长,也还是有限制的。不过比260长很多而已。
----------------------------------------------
--
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行68.35938毫秒 RSS