renaming with long file name fails

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

renaming with long file name fails

Post by *chea »

If I try to rename a file to a new name with 270 characters, it first asks me if I want to keep it, but then it fails with the error "Invalid file name specified!".
I thought that TC supports long file paths (unlike Explorer). Am I missing something or is this a bug?
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: renaming with long file name fails

Post by *Dalai »

Well, does your filename include characters like the following?

Code: Select all

< > ? | " / \ : *
If so, remove them and it will (hopefully) work.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

Re: renaming with long file name fails

Post by *chea »

No, regular allowed characters only. As soon as I type too many characters it fails, the same characters work fine till then.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: renaming with long file name fails

Post by *HolgerK »

chea wrote: 2021-06-09, 22:24 UTC If I try to rename a file to a new name with 270 characters,...
a single path name component (filename or directory-name) is still limited by windows to max 255 characters.
The complete path can be longer...
c:\can't be more than 255 characters\
c:\this\can\be\more\than\255\characters\


This may also depend on the underlying file system (ntfs, ex-fat, fat32, fat16, ...)

Regards
Holger
Make our planet great again
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

Re: renaming with long file name fails

Post by *chea »

You're right, HolgerK. I thought the new W10 long paths setting would fix this, but it doesn't.
Perhaps TC could display a more descriptive error, although the previous warning already gives the user a clue on what's going on.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: renaming with long file name fails

Post by *Dalai »

chea wrote: 2021-06-10, 11:05 UTCI thought the new W10 long paths setting would fix this, but it doesn't.
JFTR: This setting you're referring to requires applications to be made aware of this change (see this MS article). Otherwise it won't change a thing. TC has been able to support long paths for several years, even without this new Win10 setting by using the long path prefix (\\?\) which also works in older Windows versions.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

Re: renaming with long file name fails

Post by *chea »

Right.
Well, today I saw another somewhat related problem:
In short: dragging and dropping long path files from Explorer to a program's window fails, if the file is on a non-system (not C:\) drive.
When dragged and dropped from TC the file from D:\ drive fails to open (just like when using Explorer or FreeCommander, for instance). But it opens when dropped from the 7-Zip file manager.
Does anyone know why? I mean both why it fails to open from D:\ with most programs and why it succeeds with 7-Zip.
At first I thought 7-Zip is the only one of these to be W10 long path aware, but that doesn't seem to have any effect here. I can disable that setting in GP and it doesn't change anything.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: renaming with long file name fails

Post by *ghisler(Author) »

When dragged and dropped from TC the file from D:\ drive fails to open
Are you running Total Commander with higher user rights, "as administrator"? Drag&Drop does not work between programs with higher rights and programs with normal rights.
Author of Total Commander
https://www.ghisler.com
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

Re: renaming with long file name fails

Post by *chea »

No. You can read the first post in that linked thread for more details. It's a problem with long file paths, but for some reason (Windows bug?) the problem is only on non-system partitions. If the file is somewhere on the C:\ drive then it works fine.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: renaming with long file name fails

Post by *ghisler(Author) »

Maybe 8.3 names are disabled for this volume. Try the command
cm_SwitchLongNames
on a button or in the command line, and check whether long names are displayed as short 8.3 names or not.
Author of Total Commander
https://www.ghisler.com
chea
Junior Member
Junior Member
Posts: 43
Joined: 2005-07-23, 11:42 UTC

Re: renaming with long file name fails

Post by *chea »

Yep, that's it. Interesting, I had no idea this was a thing.

Why do files dropped from the 7-Zip file manager load anyway, though? And could TC perhaps do the same, without generating 8.3 names on those volumes?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: renaming with long file name fails

Post by *ghisler(Author) »

No idea, sorry. Maybe it passes the extra-long names in a different format, e.g. with/without prefix \\?\ or uses a different clipboard format for the files.
Author of Total Commander
https://www.ghisler.com
Post Reply