-
Notifications
You must be signed in to change notification settings - Fork 724
Path length limit of (I think) 260 characters #50
Comments
i think many of the win32 api calls have that limit, so its a limitation of win32. |
but there are ways around it. total commander for example can show that easily. |
Windows 10 has long path mode, otherwise your pretty stuck for Win32 |
w10 isnt even needed. |
Yes but Total Commander likely isn't using native Win32 |
apparently there has already been a not too-bad way before: "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). To specify an extended-length path, use the "\?" prefix. For example, "\?\D:\very long path"." let me note that I grabbed this link from here: https://stackoverflow.com/a/1066022/4426048 which is an answer from 2009 |
I am aware of the MAX_PATH win32 api limitation. |
I think there are three issues here that need to be kept separate.
|
regarding 1: true trhat is an issue. regarding 2: not just that it's w10 online, but the fact that it's an opti in also is an issue to some degree as the users have to enable it in the registry. regarding 3: |
For most drives, 260 chars is still more than necessary, given LFNs have their 8.3 equivalents, from the standpoint of the C and VC libraries. The glibc for Linux has a minimum of 256, which is even less, but should require filenamelen to be at least 14 (it's buggy there). This makes for a minimum maxdepth of 17 on dirs and name for drive letter based roots, as an interoperability consideration, and an effective maxpath length over 4k with a filename max of 255 that may need displaying, in MS applications. This is the state of affairs since FAT added LFN support; MS simply doesn't document it except by inference in providing interfaces like RtlGenerate8dot3Name. They leave it up to applications like WinFile to do any conversions of paths that long before use with the C APIs. If winfile isn't already using a MAXPATHLEN over 4000, imo that's nominally a bug that should be fixed, however many places it appears. |
Two things. First, LFNs do not always have 8.3 equivalents. Specifically:
8.3 names were there as a compatibility bridge in 1995. Today, they're on the way out. Second, it's not as simple as defining a large MAXPATHLEN. The Win32 API is limited to MAX_PATH unless the caller is willing to perform all path resolution and prepend paths with \\?\. This can be done, but it's not trivial. |
Yes, most file systems don't support storing 8.3 names separately, but when FAT was the only one MS used, pre-95, it was the only thing apps had... IIRC, Netware made use of MSDOS IFS extensions, but that was the only popular software that did. The API will generate on the fly 8.3 versions for the supported code pages, SBCS or DBCS, and current file systems, even CDFS, however. I also agree it isn't simple (requires a way more robust _splitpath()/_splitURL()/_splitUNC(), for one) or I would have uploaded a patch. |
Long Path support is a must. Additionally, being able to correctly navigate Case-Sensitive subfolders (for example, CMake versus cmake) would also be helpful for those who try to work with Linux-based filesystems. |
Almost true. We will never be able to create all those strings dynamically because we do not know the weird ways those strings are passed, and when they should be freed. So the way of choice is to update MAXPATHLEN to e.g. 1024, which is not 32767 I know, but it is an improvement
Can't go that way agreed I did a quick local hack:
And voila. the basic stuff works. Well, have to test more, I am sure a few things will pop up. ( The window caption is limited) |
Since #340 is on the main trunk, can we close this issue? |
Yep. |
I really like winfile due to it's responsiveness.
Is there any chance to get rid of the fixed max length of 260 characters for the path length?
If so, then winfile would be truly superior to Windows Explorer, which has the same problem.
The text was updated successfully, but these errors were encountered: