TCMAMDIN loses filename case when unpacking w/overwriting

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
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

TCMAMDIN loses filename case when unpacking w/overwriting

Post by *MVV »

It is an old bug (or just missed feature).

I like that TC keeps filename case when overwriting file (e.g. I keep filenames in nice case and when updating files, names are kept).

But when I unpack files with overwriting using TCMADMIN, they get exact name of unpacked file (including characters case).

E.g. if existing file has name MultiTool.dll and file in archive have name multitool.dll, after unpacking using just TC name will be MultiTool.dll as expected, but when unpacking using TCMADMIN, name will be multitool.dll.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately this cannot be prevented: tcmadmin doesn't really unpack itself. What happens is that TC unpacks the files to TEMP, and tcmadmin then copies them with CopyFileEx. Unfortunately CopyFileEx seems to have this behaviour to copy the case of the name too.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Maybe TCMADMIN can use same copy method as TC uses to copy file(s) from temporary folder to target one?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Main TC doesn't do that, it unpacks the files directly to the desired target. This isn't possible with tcmadmin because it cannot access all the packers and packer plugins. Therefore TC has to unpack the files somewhere where you have write rights, and then let tcmadmin copy the files where they belong.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Yes, you're rignt.
But TC keeps file case while copying file from one place to another with overwriting in any copy mode, even using Explorer copy mode (copy and paste)...
Also TCMADMIN keeps file case when replacing a file. So it is strange that it acts differently when copying from normal folder and temp folder... If TCMADMIN has copy method that keeps original filename why it cannot be used for copying unpacked file from temporary folder too?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, I'm using CopyFileEx in both cases...
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hi!

You wrote:
But when I unpack files with overwriting using TCMADMIN, they get exact name of unpacked file (including characters case).
I have tested that extensively, but here the overwritten file always keeps its original name, even when unpacking from zip via tcmadmin. Only the overwrite dialog is showing the wrong case, the resulting file keeps the case of the original file.

I tried both with a directory where the user had no write rights, and one where he also had no read rights - the result was the same. I tested it on Windows XP SP3.

Therefore I don't know what you are doing here. Can you give me step by step instructions to reproduce the problem?
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Please use this small ZIP:

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="test.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.zip"

UEsDBBQAAgAAAHVp0DwAAAAAAAAAAAAAAAADAAAAeXkvUEsDBBQAAgAIAH1p0DzYGf2WBAAAAAIA
AAALAAAAeXkvdGV4dC50eHSrrAQAUEsDBBQAAgAAAGxp0DwAAAAAAAAAAAAAAAADAAAAenovUEsD
BBQAAgAIAIJp0DyhG9kkBAAAAAIAAAALAAAAenovVGVYdC50eHSrqgIAUEsBAhQAFAACAAAAdWnQ
PAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAwAAAAAAAAAHl5L1BLAQIUABQAAgAIAH1p0DzYGf2WBAAA
AAIAAAALAAAAAAAAAAAAIAAAACEAAAB5eS90ZXh0LnR4dFBLAQIUABQAAgAAAGxp0DwAAAAAAAAA
AAAAAAADAAAAAAAAAAAAMAAAAE4AAAB6ei9QSwECFAAUAAIACACCadA8oRvZJAQAAAACAAAACwAA
AAAAAAAAACAAAABvAAAAenovVGVYdC50eHRQSwUGAAAAAAQABADUAAAAnAAAAAAA

It contains two folders with file whoose name differs only by character case (files have different contents so you can see which file you have in target folder).

At first, try to unpack e.g. yy\text.txt file to a folder with full access and then unpack file zz\TeXt.txt over it - filename case is preserved.
Now try the same with read-only folder (users: read-only, admins: full) and choose 'As admin'. Overwrite file - filename case is not preserved.

BTW overwrite dialog always shows both names just as file being unpacked has.

Tested on W7.

I tried to test it on WXP SP3 under user account but strange bugs found - when I tried to unpack files to read-only folder, 'file exists' dialog just had not 'as admin' button! And when I tried to unpack file to c:\windows\temp folder (which has special access rights - you can test with yours) TC didn't ask for overwrite!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I just tried it with XP SP3 too, but I did get the overwrite dialog and admin dialog, and tcmadmin preserved the target name just fine... :(

Will have to test it on Windows 7 too.

Edit: I have tested it on Vista now, and I can confirm that it behaves differently from XP. Unfortunately it's too late for TC 7.55 final now. I will try to check it after the release since it isn't a severe problem.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Just now tested on WXP SP3, same result - filename character case is not preserved. Do you test it under limited user acount?

Here a little animation.
Last edited by MVV on 2010-06-17, 08:42 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50512
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Do you testing under limited user acount?
No, I did the testing with an admin account where I set "deny read" and "deny write" rights to specific folders.
Author of Total Commander
https://www.ghisler.com
Post Reply