Synchronize Dirs - results sometimes missed
Moderators: white, Hacker, petermad, Stefan2
Synchronize Dirs - results sometimes missed
Test 1:
1) create file c:\test1\file.txt in left panel (empty)
2) create file c:\test2\file.txt in left panel (with any non-empty contents)
3) ensure that dates/times of both files are different
4) launch "Commands -> Synchronize Dirs"
5) make "by content" and "ignore date" options ENABLED
6) press "Compare" button
7) the result shows, that both files are different ("<=>" column shows "=/=")
8) right-click line with the result and click "Copy file properties ->" or "Copy file properties <-" option
9) select "Timestamp (date+time)" and press OK
10) the result still shows, that both files are different ("<=>" column shows "=/=")
Both files are still same, and the result is still same - this is OK.
Test 2:
1) AS ABOVE
2) copy this file to c:\test2\file.txt in right panel
3) modify date/time of one of these files (by using "Files -> Change Attrbutes")
4) AS ABOVE
5) AS ABOVE
6) AS ABOVE
7) the result shows, that both files are same ("<=>" column shows "=")
8) AS ABOVE
9) AS ABOVE
10) the result now is shown as unknown ("<=>" column shows "?")
Both files are still same, but the result changed to "unknown".
The fix seems to be quite simple:
- if "by content" option is ENABLED and files are different => they should remain different after synchronizing the attributes (this is already implemented)
- if "by content" option is ENABLED and files are same => they should remain same after synchronizing the attributes
Regards
1) create file c:\test1\file.txt in left panel (empty)
2) create file c:\test2\file.txt in left panel (with any non-empty contents)
3) ensure that dates/times of both files are different
4) launch "Commands -> Synchronize Dirs"
5) make "by content" and "ignore date" options ENABLED
6) press "Compare" button
7) the result shows, that both files are different ("<=>" column shows "=/=")
8) right-click line with the result and click "Copy file properties ->" or "Copy file properties <-" option
9) select "Timestamp (date+time)" and press OK
10) the result still shows, that both files are different ("<=>" column shows "=/=")
Both files are still same, and the result is still same - this is OK.
Test 2:
1) AS ABOVE
2) copy this file to c:\test2\file.txt in right panel
3) modify date/time of one of these files (by using "Files -> Change Attrbutes")
4) AS ABOVE
5) AS ABOVE
6) AS ABOVE
7) the result shows, that both files are same ("<=>" column shows "=")
8) AS ABOVE
9) AS ABOVE
10) the result now is shown as unknown ("<=>" column shows "?")
Both files are still same, but the result changed to "unknown".
The fix seems to be quite simple:
- if "by content" option is ENABLED and files are different => they should remain different after synchronizing the attributes (this is already implemented)
- if "by content" option is ENABLED and files are same => they should remain same after synchronizing the attributes
Regards
- ghisler(Author)
- Site Admin
- Posts: 48202
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
TC does this because when the time changes, it's possible that the content has changed too. TC cannot assume that the content was unchanged, but cannot assume that it was changed either, so it shows a "'?".
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Ok, this makes sense.
However, this can be still distinguished, because:
- the time has been changed due to the user-initiated action (i.e. date/time sync request)
AND
- the time that was set is NOT the current time.
When file time is changed to some value that is older than the time when the user clicked sync menu, TC could safely assume that time change was NOT due to any background operation - so still "=" could be displayed.
Regards
However, this can be still distinguished, because:
- the time has been changed due to the user-initiated action (i.e. date/time sync request)
AND
- the time that was set is NOT the current time.
When file time is changed to some value that is older than the time when the user clicked sync menu, TC could safely assume that time change was NOT due to any background operation - so still "=" could be displayed.
Regards
- ghisler(Author)
- Site Admin
- Posts: 48202
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Actually you changed it via:
You can use "Current time" there. Then TC cannot know why the time changed.modify date/time of one of these files (by using "Files -> Change Attrbutes")
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 48202
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
But you can edit a file outside of the tool and save it. This would give it the same size but different timestamp if you just replace characters, e.g. from lowercase to uppercase.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Ok, you are right.
So maybe this:
A) remember the time of pressing "Compare" button
B) after synchronizing date/time:
- if the new date/time is older than the moment of pressing "Compare" button -> still display "="
- if the new date/time is equal or newer than the moment of pressing "Compare" button -> display "?"
Regards
So maybe this:
A) remember the time of pressing "Compare" button
B) after synchronizing date/time:
- if the new date/time is older than the moment of pressing "Compare" button -> still display "="
- if the new date/time is equal or newer than the moment of pressing "Compare" button -> display "?"
Regards
- ghisler(Author)
- Site Admin
- Posts: 48202
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: