Very long filenames are truncated ContentGetValue

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Very long filenames are truncated ContentGetValue

Post by *VadiMGP »

If full path+filename length exceeds 260 chars FileName parameter in ContentGetValue function recieves truncated filename.
It is interesting to note - for different fields full name is truncated to different length(258 or 259)???

Obviously, in this case plugin returns incorrect value.

I think plugins should never be called with truncated filenames. If it is impossible to pass whole filename exceeding MAX_PATH, it will be more safly if TC itself will treat such cases like ft_fileerror.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC 7.5 will support longer names (max 1k), but not names of unlimited length, sorry.
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

Increasing filename length would be nice, but it wasn't my point. There always will some limit, it is Ok. I spoke about problem when filename exceeds this limit (as it may be).
Currently, when filename is too long you call plugins with truncated and therefore wrong filename.
If file with truncated name doesn't exists it is a small problem, but when such file exists, plugin returns incorrect result.
Total Cummander
Junior Member
Junior Member
Posts: 14
Joined: 2006-11-30, 12:35 UTC

Post by *Total Cummander »

bump :)

sorry for resurrecting, but today i hit the wall with this one.
i moved some files with very long names (classical music notation, its composer blah blah sonata blah blah key..... VERY long).
files resided in root of drive, and after moving them to the sub/sub/directory with pretty long name itself, majority of file names were truncated beyond recognition. it's VERY huge directory, and i'm horrified by prospect of manually fixing them myself :)

so, please, if it's possible, implement some kind of warning that would prevent dumb people like me doing the same thing. loosing information just by moving files around is a an awful windows quirk that should be somehow dampened in quality software like tc.


thanks in advance.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2Total Cummander
Generally I agree here, a warning would be nice (if it doesn't cost too much CPU time for checking).

But:
ghisler(Author) wrote:TC 7.5 will support longer names (max 1k)
Do you think, you will exceed this limit, too?
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Total Cummander
Junior Member
Junior Member
Posts: 14
Joined: 2006-11-30, 12:35 UTC

Post by *Total Cummander »

:)
nah, i don't think i would exceed THAT limit :)

but i'm not sure what kind of implementation that would be, afaik limit that i hit is limit of ntfs file system at 255 bytes, if there will be something to bypass that in 7.5 then great.
i wouldn't bet on it tho, so all i can do is beg for a warning dialog :)
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2Total Cummander
afaik limit that i hit is limit of ntfs file system at 255 bytes
Ah, I see. This is different to the case of the first posting in this thread,
and already discussed here: http://ghisler.ch/board/viewtopic.php?t=13600

BTW, you're probably right regarding the NTFS limit; found in http://en.wikipedia.org/wiki/NTFS :
An absolute path may be up to 32767 characters long; a relative path is limited to 255 characters.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Total Cummander
Junior Member
Junior Member
Posts: 14
Joined: 2006-11-30, 12:35 UTC

Post by *Total Cummander »

thanks statusquo :)
i tried to search thoroughly, and obviously managed to post in the wrong thread nevertheless :(

thanks for the right link, there is devs answer there, big apologies to op for messing up his thread :)
Post Reply