Handling very long paths

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Handling very long paths

Post 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.

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Handling very long paths

Post 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>;
One of my scripts helped you out? Please donate via Paypal

Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Re: Handling very long paths

Post 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.

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post 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).

Twisten
Posts: 204
Joined: 27 Apr 2008 10:30

Re: Handling very long paths

Post 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 )

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post by admin »

Oh, I was not aware of that. That's great news! I'll add that to the next version. :tup:

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post by admin »

It will take a little longer because the necessary steps are a bit more involved. :cup:

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post 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).

Horst
Posts: 1093
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Handling very long paths

Post 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.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

jupe
Posts: 2805
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Handling very long paths

Post by jupe »

@Don: Have you tested adding longPathAware to the manifest, I couldn't see it in the version I am using.

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post by admin »

Oh, I know about that. I'm still scanning the battle field.

admin
Site Admin
Posts: 60619
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Handling very long paths

Post 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.

Horst
Posts: 1093
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Handling very long paths

Post by Horst »

Fix confirmed under Windows 11 :appl:
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

Post Reply