Page 1 of 1

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

Posted: 2019-03-26, 11:43 UTC
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.

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

Posted: 2019-03-26, 14:11 UTC
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

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

Posted: 2019-03-26, 14:18 UTC
by Usher
2DrShark
You should check your zip settings…

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

Posted: 2019-03-26, 14:53 UTC
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

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

Posted: 2019-03-26, 20:39 UTC
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.

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

Posted: 2019-03-28, 08:44 UTC
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.

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

Posted: 2019-03-28, 10:30 UTC
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".

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

Posted: 2019-03-28, 10:57 UTC
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.

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

Posted: 2019-03-28, 13:49 UTC
by ghisler(Author)
It also works with forward slashes, just not a slash at the end or start of the provided directory.

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

Posted: 2019-03-28, 14:50 UTC
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.

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

Posted: 2019-03-29, 19:52 UTC
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

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

Posted: 2019-03-31, 06:59 UTC
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.