-Cannot copy file as administrator if path contains >259

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

AndrewCreator
Member
Member
Posts: 122
Joined: 2011-10-10, 23:25 UTC

-Cannot copy file as administrator if path contains >259

Post by *AndrewCreator »

Definitions:

F — folder where only administrator has access.
a.txt — file with full name length >259 chars. It is located in F\some\nested\...\folders\with\long\names\a.txt.

Steps to reproduce:
  1. Run TC as restricted user.
  2. Try to copy F as administrator.
  3. Get the error.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

What happens when you try that with Explorer :?: :twisted:
Hoecker sie sind raus!
AndrewCreator
Member
Member
Posts: 122
Joined: 2011-10-10, 23:25 UTC

Post by *AndrewCreator »

2Sir_SiLvA, why not to try yourself? :?: :twisted:
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Sorry I cant i dont have files and path longer then my os supports :evil:
AndrewCreator
Member
Member
Posts: 122
Joined: 2011-10-10, 23:25 UTC

Post by *AndrewCreator »

2Sir_SiLvA, may be you have missed the fact, that TC can handle up to 1023 chars in path?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6975
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

AndrewCreator wrote:2Sir_SiLvA, may be you have missed the fact, that TC can handle up to 1023 chars in path?
A path lenght doesn't mean that every subdir or filename may be that long.
Long pathes are necessary for file servers with user and project sub-dirs.

Trying to have filenames itself that long means you no longer need any content because the name says it all :D
AndrewCreator
Member
Member
Posts: 122
Joined: 2011-10-10, 23:25 UTC

Post by *AndrewCreator »

Guys, are you kidding? Full name consists of path and file name. Neither dir or file name length exceeds 259 chars, but full name exceeds it. TC successfully copies file as user, but fails if copying is invoked via tcadmin.exe.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Question

1. what error did you get? (press Ctrl+C and paste here)

2. what is the target? A mapped share you need credentials to access?


Or the other way round: does copying just a file like "F:\test.txt" succeed?


.
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

AndrewCreator wrote:TC can handle up to 1023 chars in path?
Really? Why that limitation? There was a "legacy" limit of 260 characters, extended path length in Windows can be about 32767 characters.

Just curious.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2AndrewCreator
Sorry, there are currently no plans to support names longer than 259 characters in the admin tool.

2JFierce7
No, that's not true - normal Windows functions do not work with paths > 259 characters. The limit of 32767 is for the NTFS file system and its low level functions, not for Windows API.
Author of Total Commander
https://www.ghisler.com
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

ghisler(Author) wrote:The limit of 32767 is for the NTFS file system and its low level functions, not for Windows API.
No, it's not necessarily limited to NTFS or some mysterious low level functions. There are lots of (Unicode versions of) Windows API functions which accept a "\\?" prefix to support path names with extended length.

I had the impression, TC is using these functions (since it worked for me for long path names). Hence I wondered where this "1023" came from.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

FAT32 partitions also support paths longer than 259 characters.
ghisler(Author) wrote:normal Windows functions do not work with paths > 259 characters
To be more precise, shell functions don't support such paths, but kernel functions (from kernel32.dll) support them.
AndrewCreator
Member
Member
Posts: 122
Joined: 2011-10-10, 23:25 UTC

Post by *AndrewCreator »

2ghisler(Author), is it possible to provide a relevant error message instead of "Could not read file"?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, you get warnings about name too long and access denied, so it should be clear enough that TC couldn't access the file...
Author of Total Commander
https://www.ghisler.com
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

AndrewCreator wrote:2ghisler(Author), is it possible to provide a relevant error message instead of "Could not read file"?
for that you have - again - ask microsoft they designed the os you use and thus the error messages file operations return - tc shows you excactly what your os tells him.
Post Reply