Wrong directory stucture of packed zip on drag to tab header & below current dir path

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

To reproduce:
1. Make a zip archive with some file (e.g. test.ext), it will be created in opposite panel. Let it be c:\test.zip
2. Open that archive in that panel.
3. Drag some file from source panel to opened archive's tab header (if it's not locked) or archive name in below current diectory (aka address bar).
4. In pack dialog, change path from c:\test.zip/dir1/dir2/dir3/ and press OK.
Expected: file should be packed as c:\test.zip/dir1/dir2/dir3/test.txt
What happens: files is packed to /dir1/dir2/dir3/\dir1\dir2\dir3\ where \dir1\dir2\dir3\ is a name of subdir in zip.
Edit: Expected behavior happens if in step 3 to drag file just to opposite panel. - it seems bug happens in this case too.
Last edited by DrShark on 2019-03-26, 15:18 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *ghisler(Author) »

I cannot reproduce that. If I change the path to
c:\test.zip/dir1/dir2/dir3
the file will be packed to
c:\test.zip/dir1/dir2/dir3/test.txt
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *Usher »

2DrShark
You should check your zip settings…
Andrzej P. Wozniak
Polish subforum moderator
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

I just reproduced it with fresh ini.
I created empty file c:\totalcmd\test\arcdirsbug\test.ext
Both in left and right panels opened c:\totalcmd\test\ (in second panel in second tab so tabs are visible).
Then packed test.ext to zip and got c:\totalcmd\test\arcdirsbug\test.zip.
In right panel (with tab) I opened test.zip
Switched to left panel, selected file test.ext, dragged it to opposite panel's tab header.
Pack files dialog appeared.
In it, I changed zip:c:\totalcmd\test\arcdirsbug\test.zip
to zip:c:\totalcmd\test\arcdirsbug\test.zip/dir1/dir2/dir3/
Then archiving.
When archiving finished, I go in archive's tab in dir1, then dir2, then dir3 and in it
I see a directory "dir1\dir2\dir3\". When enter it, there is a file test.ext
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *ghisler(Author) »

I can now reproduce it, thanks. The error occurs when you end the path with a forward slash.
The following works correctly:
c:\test.zip/dir1/dir2/dir3
The actual correct syntax would be
c:\test.zip/dir1\dir2\dir3 <- this is what you get when you press F5 with a zip subdir in the target panel
or
c:\test.zip/dir1\dir2\dir3\
which also work correctly. TC just doesn't like the trailing forward slash. I have updated my post above to reflect that I didn't enter a trailing forward slash in my first test.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

I already wrote about it in email: the same "dir1\dir2\dir3\" subdir is created if it to create a path /dir1/dir2/dir3/ with F7 being inside of archive.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *ghisler(Author) »

Yes, it's due to the trailing backslash. I will remove it. The correct way to provide the name would be "dir1\dir2\dir3".
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

ghisler(Author) wrote: 2019-03-28, 10:30 UTCThe correct way to provide the name would be "dir1\dir2\dir3".
Different slashes it the best way to distinguish path in filesystem and inside of archive, also a trailing forward slash in a path makes it clear that last name is a name of a dir, and not a file. I mean for, for a path c:\test.zip\dir1\dir2\dir3 it's not clear whether test.zip is an archive or directory, and whether dir3 is a file or directory.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *ghisler(Author) »

It also works with forward slashes, just not a slash at the end or start of the provided directory.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

ghisler(Author) wrote: 2019-03-28, 13:49 UTC It also works with forward slashes, just not a slash at the end or start of the provided directory.
Yes, that's how it works right now. But you wrote:
ghisler(Author) wrote: 2019-03-28, 10:30 UTC Yes, it's due to the trailing backslash. I will remove it. The correct way to provide the name would be "dir1\dir2\dir3".
It's not clear what back slash did you mean (or you meant forward one?) and from second part of your message it's not clear whether it will be possible to use starting or trailing forward slash of path in dir creation and copy dialogs.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *DrShark »

history922.txt wrote:27.03.19 Fixed: F7 new folder: Invalid name created when user specifies path in zip incorrectly with starting and/or trailing slash, e.g. /dir1/dir2/dir3/ (32/64)
I can confirm it fixed in TC 9.22a.
A moment users should be aware of:
* path starting with forward (common) slash in format /dir1 or /dir1/ used in F7 dialog in archive will create a subdirectory "dir1" in it.
* path starting with back slash in format \dir1 or \dir1\ used in F7 dialog in archive will create a "dir1" folder in a root of the root of the drive on which the archive is located..

BTW, this bugreport also helped to find and fix following bug:
history922.txt wrote:29.03.19 Fixed: Difficult to reproduce crash in F7 new folder inside ZIP archives (timing problem with removing progress dialog) (32/64)
which could cause an infinite loop hang that could only be stopped with PC reboot.

Edit: corrected post to reflect info from next post
Last edited by DrShark on 2019-03-31, 13:06 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong directory stucture of packed zip on drag to tab header & below current dir path

Post by *ghisler(Author) »

path starting with back slash in format \dir1 or \dir1\ used in F7 dialog in archive will create a "dir1" folder in a root of c:\ drive.
Actually it's created in the root of the drive on which the archive or current directory is located.
Author of Total Commander
https://www.ghisler.com
Post Reply