Serious bug in sync directories/zip mode that deletes files!
Moderators: Hacker, petermad, Stefan2, white
Serious bug in sync directories/zip mode that deletes files!
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.
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.
Re: Serious bug in sync directories/zip mode that deletes fi
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.
(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.
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
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.
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
#128099
If I want to delete everything I do not need the compare view.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.
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.
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.
Karl
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.
HTH,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.
Karl
The optimum whould be, if this is the same.karlchen wrote:T.C. does what you tell it to do not what you expect it to do.

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.
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
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
- fenix_productions
- Power Member
- Posts: 1979
- Joined: 2005-08-07, 13:23 UTC
- Location: Poland
- Contact:
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
#128099
Previous versions (<= 7.04) never delete files that are not listed in the sychronize view, when selected all (ctrl-a) > delete left/right.karlchen wrote:So far I have not found a hint that T.C. 7.50 PB3 behaves differently from previous versions
This behaviour comes up with the new "empty directories" checkbox.
Please, correct me, if I'm wrong.
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.A ZIP file is not a real subfolder.
That could lead to unwanted data loss! (as described by za222)
I do NOT select "everything"!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 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.
Yes, this makes it more clear and is what I meant with "files that are not listed in the sychronize view".I have the view set up so only RED ("X") files are shown (blending out the green ("->") and black ("=") ones).
TC deletes files that are filtered out in the sync view.
Of course you should have a backup, especially because you use a beta version of TCI would've lost lots of important stuff if i hadnt had an additional backup

- ghisler(Author)
- Site Admin
- Posts: 50840
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
-
- Junior Member
- Posts: 63
- Joined: 2006-02-06, 08:51 UTC
- Location: antwerp, belgium
- ghisler(Author)
- Site Admin
- Posts: 50840
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
-
- Junior Member
- Posts: 63
- Joined: 2006-02-06, 08:51 UTC
- Location: antwerp, belgium