-Compare by content: files not closed?

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Wojciech Furmanik
Junior Member
Junior Member
Posts: 5
Joined: 2010-02-25, 06:32 UTC

-Compare by content: files not closed?

Post by *Wojciech Furmanik »

After activating "Compare by content" window, it is not possible to modify compared files (probably still open). Is this done on purpose? Previous versions behaviour was different - after edit (notepad) and regaining focus by "Compare contents" window, there was a message: "Recompare?"
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

This depends on file sizes.

Files < 1MB are buffered in the memory and closed, so you can edit them.
Files >= 1MB use system feature called "mapping view of file in the memory", so files are locked for writing until comparing finishes. This also has another side effect - you can't compare files larger than the available address space (4GB in 32-bit Windows).

This may change in the future, so you would be able to edit even >= 1MB files during comparison, and you would be able to compare even very large files - a bit more info here:
http://www.ghisler.ch/board/viewtopic.php?t=38786

Regards
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

after edit (notepad) and regaining focus by "Compare contents" window, there was a message: "Recompare?"
It still works like that for me - I havent tried with txt files larger tann 1Mb as described by MarcinW
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Wojciech Furmanik
Junior Member
Junior Member
Posts: 5
Joined: 2010-02-25, 06:32 UTC

Post by *Wojciech Furmanik »

MarcinW wrote:Files < 1MB are buffered in the memory and closed, so you can edit them.
Good to know.
It is true: the first file I compared with TC8.5 was bigger than 1MB, so my guess was that the function has changed. I was wrong :)
Thanks!
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

It has changed, but back in the beta phase of Version 8.0 (beta 19), probably due to my bug report.

The problem is that the files are mapped for size > 1024k and you must not able to edit the file it when this is done,
(especially lowering the file size) because it causes data corruption.

The discussion already linked shows that this *may* change in one of the next major versions, i.e. dropping the file mapping.
But until that I think it would be best to have a configurable memory limit, e.g. for up to 20 MiB or so, in the INI file.

I like TC's CBC tool and prefer it over many other similar ones,
but the 1 MiB limit really is not appropriate anymore on modern systems with multiple Gigabytes of main memory.
I have tons of configuration and log files that easily go over one Megabyte, probably just like many other people too, so...
Post Reply