Bug opening files with overlong paths (259+ characters)

Things you’d like to miss in the future...
Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

Hello and thank you for developing a wonderful app like XYplorer! :appl:

I have encountered some bugs regarding overlong filepaths. Here is what I found.

Versions 24.80 and later of XYplorer can fail to open files when their total path length is longer than 259 characters.

Previous versions of XYplorer (such as 24.60) successfully open overlong filepaths by using the DOS 8.3 short filenames.

According to the changelog, a "longPathAware" flag was added to the application manifest in version 24.80.

Using an app called Process Explorer to inspect the shell commands, it seems XYplorer now tries to directly open overlong filepaths instead of using the 8.3 short names. Some programs cannot handle these overlong paths and fail to open.

POTENTIAL FIX: I believe XYplorer should try to open overlong filepaths using DOS 8.3 short names. This seems to be the behavior of XYplorer 24.60 and earlier, and it should improve compatibility opening files in older applications.

TIP: Enable the "Show Name Length While Renaming" option in XYplorer for easier testing. I tested both TXT and JPEG files with overlong paths. The files should be placed in a folder with a long name (200+ characters), and then adjust the filename so the total path length is over 259 characters. Try to open the overlong files from XYplorer, and then shorten the names and try again.


Thank you, and let me know if you need more information!

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

Thanks for the report!

- How do you try to open the files, context menu? Double click?
- What type of file is it?
- What is the opening application?

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

Hello, the bug occurs when double clicking certain files in XYplorer with overlong PATHS (folder length + filename length > 259 chars).

Popular apps like VLC Player (video player) and Notepad++ (text editor) cannot handle overlong files when opened by XYplorer. However, they can open 8.3 short filenames!

Here are steps to reproduce for VLC Player (you can also do similar steps for Notepad++):

NOTE: VLC Player needs to be installed and set to the default video player with file associations.

1) In latest version of XYplorer, enable the "Show Name Length While Renaming" option we can see the length of file paths. The setting is in the config menu "General > Sort and Rename"
2) Go to C:\ drive and create a new folder that is 200 characters long.
3) Copy a video file into this folder.
4) Rename the video file and make sure the total path length is less than 260 characters. Double click the video to open it in VLC Player.
5) IMPORTANT: Now rename the file and make it longer (60+ chars) so that its total path length (FOLDER LENGTH + FILENAME LENGTH) is over 260 characters.
6) Double click the file and it should fail to open
7) Shorten the filename again (so the total path length is less than 260 chars) and it should now open


I believe the fix would be for XYplorer to open files with overlong paths (greater than 259 chars) using 8.3 DOS short names (for example "C:\DOWNLO~1\NEWAWE~1.TXT")

NOTE: XYplorer 24.60 and earlier don't have this bug because they use 8.3 filenames for overlong paths. I verified this by double clicking overlong files and checking the XYplorer.exe shell command in Process Explorer. XYplorer 24.80 and later pass the HUGE overlong filepath on the shell causing trouble with some older apps!

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

Thanks. Select one of those overlong path files, and click menu File | To Clipboard | Item Short Path/Name(s). Is the correct short path copied to the clipboard?

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

No, the overlong path (300+ chars) is copied to the clipboard instead of the short path :) :bug:

If you can fix this in a beta build, I would be happy to help you test it. :tup:

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

Have you tested 24.60 on the same machine? Because I just tested 24.50 and it behaves no different than 25.90.

Sorry, that was wrong. I have 8dot3 name creation per volume enabled (NtfsDisable8dot3NameCreation = 2), and I have it enabled for C: but not for E: (that can be done using fsutil).

Turns out I can confirm what you said. Working on the fix...

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

OK, should be fixed in next beta.

Note that I was not as wrong as I thought, at least I could not reproduce that versions 24.60 and earlier could do it. But the next beta will. :beer:

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

Thank you, I have downloaded and tested the new beta version. Here is what I found.

1) Using the menu option "File | To Clipboard | Item Short Path/Name(s)" now successfully copies the short paths. :tup:

2) Double clicking (or using context menu) to open overlong files in XYplorer still does not use the short names. :bug: I have 8dot3 name creation enabled on all my drives. Here are some pictures:
  
Attachments
My overlong file in the newest beta build
My overlong file in the newest beta build
1.png (29.25 KiB) Viewed 158 times
When double clicked in XYplorer, it still fails to open
When double clicked in XYplorer, it still fails to open
2.png (7.32 KiB) Viewed 158 times
The shell command when double clicking the file in XYplorer
The shell command when double clicking the file in XYplorer
3.png (25.19 KiB) Viewed 158 times
The shell command when double clicking the file in Windows Explorer
The shell command when double clicking the file in Windows Explorer
4.png (18.14 KiB) Viewed 158 times

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

Indeed! :om: Try 25.90.0151.

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

I tried the newest beta and overlong files still don't open when double clicked. :(

On the event handler for opening files, does XYplorer get 8.3 short names before opening overlong files? Maybe the code is only checking file *name* length instead of total path length? (folder path + filename > 259 chars)
 
Attachments
error.png
error.png (53.26 KiB) Viewed 136 times

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

No, everything here is done correctly and works perfectly. There must be another factor. Can anyone else reproduce overlong items still not opening in applications that do not support overlong items?

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

On a LongPathAware Windows 10, I could see problems with overlong items, and have now fixed them (25.90.0152). However, I could not reproduce your problem, so it remains a thrill.

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

Yes, I am using LongPathAware Windows 10 64-bit. I'm sorry I did not mention that. Windows is weird sometimes, lol :)

I tested the newest beta version v25.90.0152.

1) Good news -- overlong files now successfully open when double clicked! Nice job! :tup:

2) Bad news -- when right-clicking overlong files and opening with context menu, XYplorer does *not* use the short names. Check out my screenshots.
 
Attachments
1.png
1.png (48.85 KiB) Viewed 58 times
2.png
2.png (54.75 KiB) Viewed 58 times

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

Re: Bug opening files with overlong paths (259+ characters)

Post by admin »

Julia1995 wrote: 17 May 2024 19:33 2) Bad news -- when right-clicking overlong files and opening with context menu, XYplorer does *not* use the short names. Check out my screenshots.
News? Does that mean it was not the case with v25.90.0151?

Julia1995
Posts: 11
Joined: 13 May 2024 20:06

Re: Bug opening files with overlong paths (259+ characters)

Post by Julia1995 »

For v25.90.0151, *both* double clicking and context menu did *not* open the overlong files.

For v25.90.0152, double clicking now successfully opens overlong files, but the context menu does not. :)

Post Reply