Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAX_PATH limitation on Windows #110

Open
VADemon opened this issue Apr 12, 2018 · 0 comments
Open

MAX_PATH limitation on Windows #110

VADemon opened this issue Apr 12, 2018 · 0 comments

Comments

@VADemon
Copy link

VADemon commented Apr 12, 2018

#15

From MSDN:

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.

It's possible for all FS functions to use path lengths >260 characters now if the required registry key is set on Windows 10:

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled=1 (Type: REG_DWORD)

With this setting it's possible to create 32,767 long paths without using the specific Unicode Win32 API functions and the path prefix \\?\

Though still, each folder/file aka "component" name length cannot exceed 255 characters:

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters).

https://github.com/keplerproject/luafilesystem/blob/884b52a3b29661a10e183daf4cea7a37698f404b/src/lfs.c#L99 pattern length

https://github.com/keplerproject/luafilesystem/blob/884b52a3b29661a10e183daf4cea7a37698f404b/src/lfs.c#L186 get_dir function buffer size

https://github.com/keplerproject/luafilesystem/blob/884b52a3b29661a10e183daf4cea7a37698f404b/src/lfs.c#L555 dir_iter_factory: directory iterator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant