[FIXED] Archive destruction when extracting and overwriting

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

[FIXED] Archive destruction when extracting and overwriting

Post by *icfu »

When an archive is overwritten with a contained file with the same name as the archive, the archive is destroyed.

Example with internal ZIP:
C:\test.zip\bla.txt
C:\test.zip\test.zip

Overwrite C:\test.zip with C:\test.zip\test.zip, accept overwrite warning:
=> C:\test.zip has 0 bytes.

Example with SQX plugin:
C:\test.sqx\bla.txt
C:\test.sqx\test.sqx

Overwrite C:\test.sqx with C:\test.sqx\test.sqx, accept overwrite warning:
=> C:\test.sqx is gone.

WinRAR doesn't show this behaviour, the original file survives!

Tested with TC 7.03 and TC 6.58.

Icfu
Last edited by icfu on 2008-08-01, 08:47 UTC, edited 1 time in total.
This account is for sale
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Confirmed (TC7.03, Win2k SP4).

Everything OK (overwriting itself on extracting does NOT happen) with:
- ACE: WinACE 2.61
- RAR (internal + external: WinRAR 3.71)
- TAR (internal + external: WinRAR 3.71)
- ZIP external: PKUNZIP 2.50

0 Byte sized archive using:
- ZIP (internal)

Archive deleted using:
- ARJ 2.41
- LZH 2.13

Archive destroyed (containing only some NULL-bytes) using:
- GZ (internal; test.gz\test.gz)

Opening and unpacking the archive not possible:
- UC2: UC2r3 (test.uc2\test.uc2)
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49100
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

What do you expect when doing such a foolish thing? Sorry, but Total Commander cannot prevent every possible user error. :(
Author of Total Commander
https://www.ghisler.com
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

I would expect TC to not allow overwriting a currently opened archive, I guess.
Isn't it TC which is able to lock directories from deleting which are only opened in TC and nowhere else?
TC shows so many foolish confirmation boxes daily, like "no text selected" in lister, although no data loss can occur, that I really wonder about your weird reaction on my bug report.

I would also expect you to not answer in the forum if someone has pissed in your coffee in the morning. That's not my fault! :evil:

Icfu
Last edited by icfu on 2008-05-08, 16:27 UTC, edited 1 time in total.
This account is for sale
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49100
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, TC doesn't lock the file which is currently being unpacked, so you can for example already look into the currently unpacked file while it is still unpacking in the background, or unpacking other files from the archive. It also allows to unpack files from archives which are currently opened in other programs, e.g. while they are still downloaded. All this wouldn't be possible if either the source or the target is opened with exclusive access... :(
Author of Total Commander
https://www.ghisler.com
User avatar
norfie²
Power Member
Power Member
Posts: 1020
Joined: 2006-02-10, 07:27 UTC

Post by *norfie² »

2icfu
I would prefer if you would keep polite regardless of your coma. :P
The same expressed in your words I have a good advise to the naughty icfu
I would also expect you to not answer in the forum if someone has pissed in your coffee in the morning.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

It also allows to unpack files from archives which are currently opened in other programs, e.g. while they are still downloaded.
This is true for ZIP, not for RAR. You cannot extract files from running RAR downloads.
All this wouldn't be possible if either the source or the target is opened with exclusive access...
You know the source filename.
You know the target filename.
You know the name of the currently opened archive.

Even if you don't open with exclusive access, you can prevent overwriting in the current TC instance, by making sure that target filename != opened archive name.

Icfu
This account is for sale
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

icfu wrote:Even if you don't open with exclusive access, you can prevent overwriting in the current TC instance, by making sure that target filename != opened archive name.
Hm, I must admit that this sounds pretty reasonable to me.

Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49100
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, this could be done easily, but doesn't take into account hard links, junctions etc.
Author of Total Commander
https://www.ghisler.com
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Fixed in 7.04.

Icfu
This account is for sale
Post Reply