Page 1 of 1

Very specific problem when changing attributes

Posted: 2018-12-19, 22:42 UTC
by petermad
I have stumbled over a very peculiar problem setting file attributes for 2 specific files.

I can reproduce the bug under Windows XP, 7 and 8.1 but NOT under Windows 10 on local harddisks (but on Network shares and USB-sticks)

To reproduce, download this file http://madsenworld.dk/tcmd/attribtest.zip and unpack it to a directory.

1. Set the file panel to Full View and mark both of the two files kbenhavn.gif and kbenhavn.htm
2. Open the Change Attributes dialog, click in the "a Archive" box and click OK to clear the archive attributes.
3. Notice that the "a" attributes does NOT change.
4. Click F2 and or Ctrl+R to reread the panel - no change.
5. Leave the directory and re-enter it - now the "a" attributes are cleared.
6. Mark the two files kbenhavn.gif and kbenhavn.htm again
7. Open the Change Attributes dialog, click twice in the "a Archive" box and click OK to set the archive attributes.
8. Notice that the "a" attributes does NOT change.
9. Click F2 and or Ctrl+R to reread the panel - no change.
10. Leave the directory and re-enter it - now the "a" attributes are set.

Change the name or extension of one of the files and perform the test - now everything works as expected.
Change the date or time (just 2 tenth of a second is enough) of the original files - everything works as expected.
Change the content of one of the files and reset the date to the original - everything works as expected.

So it is a mix of these particular filenames, whit these particular dates and content that is the essential for this bug to appear.
The bug does not occur when settng the attribute for each file individually.

The bug occurs in both 32-bit and 64-bit TC and it is also present way back in TC 8.52a and it is present in both panels.
I can reproduce the bug both on FAT and NTFS formatted drives.

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 01:10 UTC
by Dalai
I can confirm this behavior (tested only TC 8.52a on Win7). Maybe this has something to do with the "Manipulate connected files as a unit" setting in TweakUI (which is only available on XP and earlier). The setting is saved in the registry:

Code: Select all

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"NoFileFolderConnection"=hex:01,00,00,00
OTOH the setting's name suggests only connections of files and folders. Hm.

Furthermore, when the archive attribute is removed from the files, and you extract them again from the archive (overwriting the existing files), the same issue occurs, i.e. leaving and re-entering the directory is necessary to see the change in attributes. Adding another file to the directory and including that in the selection and attribute change doesn't reveal the issue.

You've found a really strange one :).

Regards
Dalai

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 04:43 UTC
by MVV
I can't confirm, both files have unchecked A attribute when I unset it in Attributes dialog.

AFAIK mentioned "Manipulate connected files as a unit" option only affects special "<html file name w/o extension> Files" folder near the html file, not such single image files... And usually I disable it on my machines because I don't like such side effects. But on this machine it is enabled (I haven't noticed it yet because I don't use Explorer and don't save web pages with contents in a folder, I prefer MHT format).

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 10:59 UTC
by ghisler(Author)
TC uses a checksum to decide whether a directory content has changed or not - if the checksum is unchanged, the directory will not be refreshed. This is necessary to avoid constant flashing when switching back to TC. Apparently you found such a rare case where the checksums are the same, but the content is different.

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 12:00 UTC
by petermad
MVV wrote: 2018-12-20, 04:43 UTC I can't confirm, both files have unchecked A attribute when I unset it in Attributes dialog.
What OS did you test under?

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 12:18 UTC
by Horst.Epp
ghisler(Author) wrote: 2018-12-20, 10:59 UTC TC uses a checksum to decide whether a directory content has changed or not - if the checksum is unchanged, the directory will not be refreshed. This is necessary to avoid constant flashing when switching back to TC. Apparently you found such a rare case where the checksums are the same, but the content is different.
Confirmed the problem under W10 shown in my signature.
Looks like the checksum doesn't help in this case.

Re: Very specific problem when changing attributes

Posted: 2018-12-20, 14:43 UTC
by petermad
2ghisler(Author)
Apparently you found such a rare case where the checksums are the same, but the content is different.
I just found another set of files with the same behaviour: http://madsenworld.dk/tcmd/attribtest2.zip

Re: Very specific problem when changing attributes

Posted: 2018-12-21, 05:07 UTC
by MVV
ghisler(Author),
What kind of hash does TC use for such case? And what data fields does it hash?

And why it can cause the bug on one Windows or installation but not in some other one?

I can't reproduce the bug with the first set but I can reproduce it with the second set!

When I press F2, the panel flashes, but is not updated properly. It is a bug definitely. I would understand if lazy update could really reduce flashes... And, I think that TC shouldn't do a lazy refresh on cm_RereadSource, direct user command should be processed thoroughly.

Re: Very specific problem when changing attributes

Posted: 2018-12-21, 10:51 UTC
by Hacker
MVV,
When I press F2, the panel flashes, but is not updated properly.
Just by chance, does it refresh properly when using Ctrl-R? A long time ago, completely unrelated to this topic, in one folder I could reliably reproduce no refresh on F2 but a normal refresh on Ctrl-R, while Christian confirmed they were doing the same. :?

Roman

Re: Very specific problem when changing attributes

Posted: 2018-12-21, 11:25 UTC
by petermad
2Hacker
As I wrote:
9. Click F2 and or Ctrl+R to reread the panel - no change.
2Hacker

Re: Very specific problem when changing attributes

Posted: 2018-12-21, 11:32 UTC
by MVV
Hacker,
Nope, both F2 and Ctrl+R are unable to refresh until directory contents changed or I re-enter directory.

Re: Very specific problem when changing attributes

Posted: 2018-12-21, 12:24 UTC
by Hacker
petermad,
Yes, that's why I asked MVV, hoping perhaps he could reproduce what noone else could.

MVV,
Thanks.

Roman

Re: Very specific problem when changing attributes

Posted: 2018-12-24, 11:24 UTC
by ghisler(Author)
I'm using some sort of CRC-32 function. I will check why it's not detecting the attribute change.

Re: Very specific problem when changing attributes

Posted: 2019-11-10, 12:47 UTC
by petermad
This problem still exist in TC 9.5b4