Serious bug in sync directories/zip mode that deletes files!

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

Moderators: Hacker, petermad, Stefan2, white

User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

Serious bug in sync directories/zip mode that deletes files!

Post by *za222 »

I've found a pretty serious bug:

I have a directory and a zip that contains a backup that i want to update using compare directories:


Directory:
DirA\File1.dat
DirA\File2.dat
DirB\File1.dat
DirB\File2.dat
DirC\File1.dat
DirC\File2.dat

Zipfile
DirA\File1.dat
DirA\File2.dat
DirA\File3.dat
DirB\File1.dat
DirB\File2.dat
DirB\File3.dat
DirC\File1.dat
DirC\File2.dat
DirC\File3.dat

So all the File3.dat files need to be removed in the zip.
But:
when i press CTRL-A to select everything in the compare view, then right mouse -> delete right
it deletes the whole folders and everything is gone!

This behavious is connected to the "[x] Empty Directory" checkbox. If that one is unchecked, it only deletes the files (like it has always been in previous version).
But when checked it seems to also extend the delete operation to the folders which are selected in the list, but in this case they are NOT empty.
User avatar
donner
Member
Member
Posts: 161
Joined: 2004-11-24, 10:30 UTC
Location: Germany

Re: Serious bug in sync directories/zip mode that deletes fi

Post by *donner »

Can confirm this! (TC7.50B3)

(It deletes 2 of 3 directories on my machine in the ZIP that have not been empty.)

Really a serious bug - should be fixed soon!

EDIT: After repeated the test, it deleted all - not only 2 - folders in the ZIP (all with files).
When try the same with real folders, not ZIPs, it works as it should/expected.
Last edited by donner on 2009-05-21, 20:30 UTC, edited 1 time in total.
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

I don't see the bug in the same place as you, guys.

For me it's clear: select everything for deletion -> everything is gone.

The only bug I see is that "Empty directories" should have no influence for this process.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
User avatar
donner
Member
Member
Posts: 161
Joined: 2004-11-24, 10:30 UTC
Location: Germany

Post by *donner »

fenix_productions wrote: For me it's clear: select everything for deletion -> everything is gone.

The only bug I see is that "Empty directories" should have no influence for this process.
If I want to delete everything I do not need the compare view.
And why does the behaviour differ (works as expected), if applied to real folders, not ZIPs?

The compareDirs>delete should not delete files that are not listed - it never did before.

Still a bug for me.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, za222.

I totally agree with fenix_productions. As you select everything and press DEL, you tell T.C. to delete everything.
T.C. does what you tell it to do not what you expect it to do.

The right approach to achieve your goal would be this one:
+ Disk folder in the left hand panel
+ ZIP File in the reight hand panel
+ Launch "Synchronize Dirs"
+ Make sure that "Asymmetric" mode is activated.
+ Press "Compare"
+ Press "Synchronize"

In case the files DirA\File3.dat, DirB\File3.dat and DirC\File3.dat are the only files which exist inside the ZIP file and not in the disk folder subtree, only these 3 files will be removed from the ZIP file.
totalcmd.chm => Dialog box: Synchronize directories wrote:Empty directories Also synchronize empty directories, not just files:

1. In normal (symmetric) mode, directories missing on one side will be copied from the other side.

2. In asymmetric mode, directories missing on the left side will be deleted on the right side, and directories missing on the right will be copied from the left side.

Asymmetric If this option is checked, it is assumed that a copy of the left side should be created on the right side. Files which do not exist on the left side will be marked for deletion on the right side. This option is meant for backups. Do NOT use this option to synchronize a desktop and notebook!

Subdirs Also compares the subdirectories of the two chosen directories. A modification of this option makes a new comparison necessary.
HTH,
Karl
User avatar
donner
Member
Member
Posts: 161
Joined: 2004-11-24, 10:30 UTC
Location: Germany

Post by *donner »

karlchen wrote:T.C. does what you tell it to do not what you expect it to do.
The optimum whould be, if this is the same. ;)

Seriously, why does TC behaves differently for ZIP folders and for normal folders? (For normal folders only the empty ones are deleted)

And if it whould be like you said:
Why does it not delete the zip folders, if the "empty directories" checkbox is not selected?

There is something wrong!
Last edited by donner on 2009-05-21, 21:01 UTC, edited 1 time in total.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, donner.

There are no subfolders inside a ZIP file. The foldernames are prefixed to the filenames. So the subfolder structure inside a ZIP file is got by getting the pathnames of the filenames.
A ZIP file is not a real subfolder.

So far I have not found a hint that T.C. 7.50 PB3 behaves differently from previous versions when you use "Synchronize Dirs" in order to synchronize a disk folder (left hand side) to a ZIP file (right hand side). And I use this function every day at minimum 3 or 4 times. - Yet, I will have an eye on it from now on. Would not like to experience a bad surprise too much.

Kind regards,
Karl
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

Hm. I must agree with one point: TC should behave the same for real folders and these in ZIP files because there is no difference between them for users. Not everyone knows how ZIPs are built and what to expect from it.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
User avatar
donner
Member
Member
Posts: 161
Joined: 2004-11-24, 10:30 UTC
Location: Germany

Post by *donner »

karlchen wrote:So far I have not found a hint that T.C. 7.50 PB3 behaves differently from previous versions
Previous versions (<= 7.04) never delete files that are not listed in the sychronize view, when selected all (ctrl-a) > delete left/right.
This behaviour comes up with the new "empty directories" checkbox.

Please, correct me, if I'm wrong.
A ZIP file is not a real subfolder.
Deleting non-empty zip folders (not the ZIP file itself but the first folders inside the ZIP file!), only because they are not sub-folders is not consistent to me.
That could lead to unwanted data loss! (as described by za222)
User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

Post by *za222 »

karlchen wrote:Hello, za222.

I totally agree with fenix_productions. As you select everything and press DEL, you tell T.C. to delete everything.
I do NOT select "everything"!

I have the view set up so only RED ("X") files are shown (blending out the green ("->") and black ("=") ones).

This gives me a quick overview of all files that arent present anymore in the source location.

By select "everything" using CTRL-A i am just selectin these files currently visible, not all of them!

But TC seems to be interpreting the directory headers between the files as a "selection for deletion" too, if the "empty directories" button is checked.
This makes no sense at all, especially as it has never been that way in earlier versions and also only seems to occur on archives, not on regular folders.

And it is obvioulsy very dangerous. I would've lost lots of important stuff if i hadnt had an additional backup as i didnt notice what has happened at first.
User avatar
donner
Member
Member
Posts: 161
Joined: 2004-11-24, 10:30 UTC
Location: Germany

Post by *donner »

I have the view set up so only RED ("X") files are shown (blending out the green ("->") and black ("=") ones).
Yes, this makes it more clear and is what I meant with "files that are not listed in the sychronize view".
TC deletes files that are filtered out in the sync view.
I would've lost lots of important stuff if i hadnt had an additional backup
Of course you should have a backup, especially because you use a beta version of TC ;) - But I agree
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50840
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed when you select a directory for deletion from an archive, the packer will assume that you want to delete that folder and everything in it. I will try to find a solution. In worst case, I will have to disable the deletion of folders from archives as it was in TC 7.04a...
Author of Total Commander
https://www.ghisler.com
bop sprengers
Junior Member
Junior Member
Posts: 63
Joined: 2006-02-06, 08:51 UTC
Location: antwerp, belgium

Post by *bop sprengers »

To avoid this problem you could simply disable 'Empty Directories' when one or both pannels are not real folder(s).
Bop Sprengers
BS-SOFT
Antwerp, Belgium
info@bs-soft.net
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50840
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, this isn't necessary. I already had some code in TC 7.5 which unselected all folders which contained files hidden via wildcards, e.g. the wildcards were *.txt and the folder contained a file of a different type. For beta 4, I have expanded this now to files which are hidden via the direction buttons.
Author of Total Commander
https://www.ghisler.com
bop sprengers
Junior Member
Junior Member
Posts: 63
Joined: 2006-02-06, 08:51 UTC
Location: antwerp, belgium

Post by *bop sprengers »

Even better. Good luck with it.
Bop Sprengers
BS-SOFT
Antwerp, Belgium
info@bs-soft.net
Post Reply