Page 1 of 1

Handling very long paths

Posted: 25 Jun 2023 16:35
by Twisten
Hi I have several files which have a very long paths (>256), when right clicking on them in XYplorer I don't get the shell context menu which I get with those files with shorter paths or when I right click on those files in windows explorer.

Another related issue is with CFA, I've tried adding "mkv>mswindowsvideo://" which launches the "Movies&TV" app (which can handle long paths) but doesn't open the long path file it seems because it's truncated somewhere along the way.

I'm using Windows 10 and enabled long path support.
XYplorer 24.00.

Re: Handling very long paths

Posted: 25 Jun 2023 17:30
by highend
Support overlong filenames is ticked in the config?

what is shown when you use this instead, the full or a truncated path?
mkv>::text <curitem>;

Re: Handling very long paths

Posted: 25 Jun 2023 18:45
by Twisten
Yes, Support overlong filenames is ticked.
When I use that (or echo which I used to test before) the full path is shown, yet it doesn't seem to get to the app.

Re: Handling very long paths

Posted: 25 Jun 2023 19:31
by admin
The Windows shell only supports paths up to 259 characters. So the shell context menu will not show for longer paths (and also all other shell functions will fail). XYplorer itself allows paths up to 32,767 characters without problems (that's the NTFS limit).

Re: Handling very long paths

Posted: 26 Jun 2023 02:50
by Twisten
admin wrote: 25 Jun 2023 19:31 The Windows shell only supports paths up to 259 characters. So the shell context menu will not show for longer paths (and also all other shell functions will fail). XYplorer itself allows paths up to 32,767 characters without problems (that's the NTFS limit).
But it works in windows explorer? Both for opening the files and displaying the shell context menu.
Isn't there an alternate way to pass it along that doesn't run into this issue?
Isn't enabling long path support in Windows is suppose to remove that limit?
( https://learn.microsoft.com/en-us/windo ... s=registry )

Re: Handling very long paths

Posted: 26 Jun 2023 09:08
by admin
Oh, I was not aware of that. That's great news! I'll add that to the next version. :tup:

Re: Handling very long paths

Posted: 20 Jul 2023 09:03
by admin
It will take a little longer because the necessary steps are a bit more involved. :cup:

Re: Handling very long paths

Posted: 19 Aug 2023 08:45
by admin
I've read about it now here: https://learn.microsoft.com/en-us/windo ... s=registry

At the bottom it says:
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.
This is confusing since all these API already now can handle overlong names (up to 32,767 characters), even already in Win XP. I don't see what I get additionally by LongPathsEnabled.

Are you sure that you can show a shell context menu for overlong files in Explorer? (The necessary API functions are not mentioned on above page).

Re: Handling very long paths

Posted: 19 Aug 2023 13:52
by Horst
For me, Windows Explorer has no problems to show a shell context menu for overlong files in Explorer.
Also, Total Commander and Everything have no problems and show the full context menu.
XY only shows its own short context menu for such names.
Long Path is enabled, of course.

Re: Handling very long paths

Posted: 19 Aug 2023 19:38
by jupe
@Don: Have you tested adding longPathAware to the manifest, I couldn't see it in the version I am using.

Re: Handling very long paths

Posted: 19 Aug 2023 19:43
by admin
Oh, I know about that. I'm still scanning the battle field.

Re: Handling very long paths

Posted: 22 Aug 2023 15:22
by admin
Check out v24.80.0021 - 2023-08-22 15:20: viewtopic.php?p=213556#p213556

The shell context menu should work now for overlong paths.

Re: Handling very long paths

Posted: 22 Aug 2023 16:00
by Horst
Fix confirmed under Windows 11 :appl: