[7.56a] Warning for long file name is wrong

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[7.56a] Warning for long file name is wrong

Post by *white »

Create a file in the root of a drive named:

Code: Select all

12345678901234567890...123456789012345
(file name length = 255)

Now, select the file and press Shift+F5 to copy the file to the same folder. Add "6" after the file name. Total Commander does not display a warning but tries to copy the file which fails. Cancel the operation.

Now, again select the file and press Shift+F5 to copy the file to the same folder. Add "67" after the file name. Total Commander does display a warning saying the target name length is 260 (which is correct) and that the last part of the file name is 258 characters long. The last part of the file name is however 257 characters long and not 258! Moreover Total Commander reports the maximum file length is 256. However trying to create a file with a name length of 256 fails. Also according to wikipedia page about NFTS the maximum file length is 255.

Tested using Windows XP on a FAT32 drive and a NFTS drive.
Last edited by white on 2011-09-04, 15:26 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Confirmed - also using Windows XP on a FAT32 drive and a NFTS drive.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48085
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is a Windows limit, not a Total Commander limit. You can't do this in Explorer either. The individual name parts of a path cannot be longer than 255 characters, so all TC can do is show a rename error.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:This is a Windows limit, not a Total Commander limit. You can't do this in Explorer either. The individual name parts of a path cannot be longer than 255 characters, so all TC can do is show a rename error.
Please reread. Total Commander thinks the limit is at 256 characters which isn't a Windows limit nor a limit of Total Commander. Also, Total Commander is reporting the wrong length for the last part of the file name.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48085
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems that you are confusing some things here. The 255 character limit is not for the entire name, it's for individual name parts! See e.g.
http://www.ntfs.com/ntfs_vs_fat.htm

So if you have c:\path1\path2\name1

each of "path1", "path2" and "name1" cannot be longer than 255 characters.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:It seems that you are confusing some things here. The 255 character limit is not for the entire name, it's for individual name parts! See e.g.
http://www.ntfs.com/ntfs_vs_fat.htm

So if you have c:\path1\path2\name1

each of "path1", "path2" and "name1" cannot be longer than 255 characters.
Exactly. But Total Commander says the size can be 1 character longer!
Moreover if name1 is 257 characters, Total Commander says it's 258 characters.
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)

You must read the first post more carefully ;-) White is right as far as I can see.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48085
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Total Commander only warns when the total path length (including drive letter any any subdirs) becomes longer than 259 characters, because that's the maximum most Windows program can handle. Total Commander does NOT warn when individual name parts become longer than 255 characters, because it couldn't be used even if the user would want to allow it! Therefore all TC can do is let the operation fail.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Total Commander does NOT warn when individual name parts become longer than 255 characters..
So that's by design. Then, two bugs remain. One is saying the maximum length of the last part is 256 characters. And the other is saying the last part is 1 character longer than it actually is.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48085
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, TC calculates the last path including the last backslash, that's why you get 258 and 256 instead of 257 and 255.
Author of Total Commander
https://www.ghisler.com
Post Reply