Page 1 of 1

MAX_PATH

Posted: 28 Dec 2016, 06:30
by just me
MSDN wrote: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: ...

Source
It should be considered for v2.

Re: MAX_PATH

Posted: 20 Apr 2018, 19:04
by lexikos
I initially thought that some scripts might rely on the current behaviour of Loop Files to skip long paths, so the suggestion to consider this as part of v2 was justified. However, I found a discrepancy between how Loop Files limits paths and how the OS limits paths. Basically, scripts cannot rely on Loop Files to protect them from long paths (paths which are too long to use with other commands or programs), at least when a relative path is given to Loop Files. I think the remaining risk of breaking scripts (by supporting longer paths) would be outweighed by the increase in capabilities.

As some changes were needed for Loop Files, and I saw that those changes could facilitate proper long path support, I have implemented it (though incomplete) in a new test build (branch of v1).