SyncDirs, comparing RAR by contents - overwrite requests
Moderators: Hacker, petermad, Stefan2, white
SyncDirs, comparing RAR by contents - overwrite requests
1. Create a RAR archive with several files with identical names in subdirs. If you are lazy you can just take my VirtualDisk plugin.
2. Open the archive in one TC panel, and its unpacked contents in another. Open the SyncDirs tool.
3. Select "subdirs" and "by content" checkboxes, press Compare.
4. While comparing, TC requests to overwrite the file temporarily unpacked during comparison (%TEMP%\vd_filedisk.sys in the VirtualDisk package, for example). If there are many files with identical names, it becomes very annoying…
This is quite strange, however, because when I open TEMP in another TC instance while seeing this overwrite request, the _tc subdirectory is empty, so I don't understand why TC asks to replace anything at all. Probably, some timing problems…
2. Open the archive in one TC panel, and its unpacked contents in another. Open the SyncDirs tool.
3. Select "subdirs" and "by content" checkboxes, press Compare.
4. While comparing, TC requests to overwrite the file temporarily unpacked during comparison (%TEMP%\vd_filedisk.sys in the VirtualDisk package, for example). If there are many files with identical names, it becomes very annoying…
This is quite strange, however, because when I open TEMP in another TC instance while seeing this overwrite request, the _tc subdirectory is empty, so I don't understand why TC asks to replace anything at all. Probably, some timing problems…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Not confirmed, tried on 32-bit XP SP3. I compared the archive with itself (same archive on both sides).
Maybe a virus scanner problem?
Maybe a virus scanner problem?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
ghisler(Author)
Not archive with archive, but archive with its unpacked contents.
But it seems that antivirus is indeed the source of the trouble. When I turned it off, I could not reproduce the problem…
Not archive with archive, but archive with its unpacked contents.
But it seems that antivirus is indeed the source of the trouble. When I turned it off, I could not reproduce the problem…

Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
It could be because TC is now deleting the subdir after unpacking and deleting the file. I will check that.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I have checked it now, and it's not the problem I suspected: The sync tool unpacks all the files to the _tc folder itself, not to any subfolders.
Maybe you have multiple files with the same name in that archive (in different subdirs)? Then the unpacking may fail because the scanner is still scanning the previous file, so Windows couldn't delete it...
Maybe you have multiple files with the same name in that archive (in different subdirs)? Then the unpacking may fail because the scanner is still scanning the previous file, so Windows couldn't delete it...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Yes, I wrote that in the first post.ghisler(Author) wrote:Maybe you have multiple files with the same name in that archive (in different subdirs)?
How can I check this? I don't think that the antivirus blocks the file in such a tricky way that DeleteFile returns success but the file remains where it was. So, TC should receive failure code. How does it handle it? Just ignores silently? Maybe, in such situation it would be better if TC created a subdirectory of gave the temporary file another name using e.g. the built-in auto-rename technique with adding (2), (3), etc.ghisler(Author) wrote:Then the unpacking may fail because the scanner is still scanning the previous file, so Windows couldn't delete it...
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Try with "process monitor" from sysinternals.How can I check this?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Here is the part of log:
http://flint-inc.ru/Temp/tcbeta75/syncdirs_procmon.log
It contains the removal of the file vd_filedisk.sys and checking for its existence before creating the same-named file for unpacking.
Unfortunately, I don't know what SetDispositionInformationFile means, as well as why it is used instead of DeleteFile or something like that…
http://flint-inc.ru/Temp/tcbeta75/syncdirs_procmon.log
It contains the removal of the file vd_filedisk.sys and checking for its existence before creating the same-named file for unpacking.
Unfortunately, I don't know what SetDispositionInformationFile means, as well as why it is used instead of DeleteFile or something like that…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
According to Google, SetDispositionInformationFile with "Delete: True" is the internal function to delete a file. As you can see, it returns SUCCESS, so TC assumes that the file was deleted.
I wonder what I should do in this case:
1. Wait and try again later? Unfortunately some scanners can take several seconds to scan a file
2. Rename the file before deleting? Unfortunately this may cause yet another scan with some scanners
I wonder what I should do in this case:
1. Wait and try again later? Unfortunately some scanners can take several seconds to scan a file
2. Rename the file before deleting? Unfortunately this may cause yet another scan with some scanners
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I see…ghisler(Author) wrote:According to Google, SetDispositionInformationFile with "Delete: True" is the internal function to delete a file.
Well, the most logical solution would be not to drop all files directly into _tc but reproduce the archive directory structure. This would allow to avoid name collisions.ghisler(Author) wrote:I wonder what I should do in this case:
Another possible solution I suggested above: if TC tries to create a file which exists already, do not ask user for overwriting but silently rename it into something like file(2).ext.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
OK, I have now added an auto-rename to the upcoming RC2 for the sync function only - let's hope that it helps...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: