ZTree.com  | ZEN  | About...  

 Index   Back

Bug and ZEP: Long path support   [Zeta]

By: Ben Kent       
Date: Jan 04,2023 at 20:03
In Response to: [Zeta] v2.4.206 Now Available! (Kim Henkel)

Because of this, I did some testing to find the limits of ZTree
> Added - Experimental support for resizing window via dragging
> frame edge

This post is regarding Long paths

http://www.ztree.com/ states "Supports long file and directory names", but that is only true only up to the ZTree ZMAX_PATH of 512 characters, the actual Windows limit is 32767 characters, assuming all characters are two bytes.

Docs: It would be good if the help file had a list of the various ZTree limits, and some of the Windows limits. I have updated and uploaded my ZTWMenuText.vbs script with a selected of limits, hopefully correct. http://www.ztw3.com/upfile/ztwmenutext.zip


Docs: Because of the possible problems when working with long paths, it would be good if there was a ZTree help file section that explained the problems and possible workarounds.

Docs: In ZTW.HLP line 1859 has "NOTE: Input lines are limited to a maximum of 512 characters.", whereas line 7363 has "length of the input line, which is 255 characters.", I presume line 7363 needs to be updated.

ZEP: ZTree should warn if the target filename is longer than GetVolumeInformation() lpMaximumComponentLength, 255 on NTFS.

ZEP: ZTree should warn if the path is/will be over the ZTree internal limit.

ZEP: Misleading error messages when creating directories, copying files and accessing (Alt-Info), etc. beyond ZTree's path (input line) length limit. It would be better if there were ZTree specific messages to let you know that you have hit ZTree's limits.

ZEP: Maybe ZTree could have a new larger buffer size for directory related things, which could dramatically increase the path length limit.

Bug: Directories with paths over 402 chars are not remembered when tabbing between panes, probably the old input line limit constant being used somewhere.

Bug: There are some edge cases with paths around 512, you can create a directory with a path of 513, if you try to copy a file to that directory, the "to" field is truncated to 512 because of the input line limit, so you get a directory not found message. That


Comment:
Because not all applications are long path aware, including many parts of Windows, working with files over MAX_PATH (260) may cause problems.
Examples:
Opening a file with no association should show the "How do you want to open this file?" dialog, but over MAX_PATH a Windows GUI popup will give an 1223 error, that is a Windows problem from what I can tell.
If the target application cannot handle paths over MAX_PATH (it doesn't do one of these 1. uses the Unicode syntax \\?\..., or 2. the system has LongPathsEnabled=1 and the application has longPathAware=true in it's manifest). Then it's likely that there will be some sort or error opening the file. For some use cases opening the file using the shortname (start %7) from eXecute or F9 Application menu, might workaround the issue.
Notes:
Shortnames are only generated while it's enabled, i.e. if you disable it, create a directory entry, then enable it, that entry will never have a shortname.
Run this as admin "fsutil behavior query disable8dot3 C:", to see the current state
Where there are shortnames, Windows Explorer uses them to open files over MAX_PATH, the called application might use GetLongPathName() to display the longname.


Here is a thread where there were problems opening files between the Windows MAX_PATH and ZTree ZMAX_PATH limits
16 May 2020 https://www.ztw3.com/forum/forum_entry.php?id=122969
"opening a file with 84 file with path 302 gives an OS 1223 error", i.e. file path 386, so shorter than ZMAX_PATH=400 at the time
The workaround for that issue was to switch to the shortpath by using "start %7" in eXecute or F9 Application menu.
And some of the responses to that thread, point to called applications not handling paths over MAX_PATH, which is not a ZTree problem, but maybe ZTree could have some options to paper over the cracks, similar to the "Windows Explorer" behaviour of opening launched files using the shortname (if available) when the path is over MAX_PATH.
My testing now shows that opening a file from ZTree with an association i.e. *.txt works with a file with Alt-Info w/Path: 512. But if there is no association i.e. *. then you get 1223 from the OS, start "" "%1" or start %7 shows the same issue, i.e. a Windows and not ZTree issue.

Later there was this update to ZTree
2.4.199 (20 Dec 2020: Change- Increased MAXCOL/ZMAX_PATH from 400 to 512
Which leads to this question
How many buffer limits/constants are there in ZTree? and are they consistent?
Input line length
MAXCOL
ZMAX_PATH
DW remembered highlighted directory buffer
F9 Application menu, editor line length
F9 Application menu, generated file line length
Max lines
...

84 views      
 

Messages in this Thread

 
96,194 Postings in 12,153 Threads, 350 registered users, 30 users online (1 registered, 29 guests)
Index | Admin contact |   Forum Time: Jan 27, 2023 - 2:18 am UTC  |  Hits:53,204,600  (1,833 Today )
RSS Feed