Compare & Edit large files bug

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Compare & Edit large files bug

Post by *MVV »

I found a bug, then I tried to repeat it with other file.

I've created a file with following content copypasted some times:

Code: Select all

1	1	1	1	1	1679		1	1	1	1	1	67214
1	1	1	1	1	1680		1	1	1	1	1	67215
1	1	1	1	1	1681		1	1	1	1	1	67216
...
1	1	1	1	1	13844		1	1	1	1	1	79379
1	1	1	1	1	13845		1	1	1	1	1	79380
File size is about 4 MB. I made a copy of a file and removed 39 lines from it. I wanted to compare two large different files.

Then I tried to compare files and to make some changes in one file, save it (by pressing Compare button), again make some changes, again save... but TC said "Unable to create output file!"

I had repeated situation many times, second save fails always (restart compare, repeat making changes - second save fails again).

Tested with 7.50PB6, 7.04a.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48121
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Saving via the Compare button is the wrong method, please use the save button (the one with the disk icon) instead. Using the compare button disturbs the .bak file management because the file is re-loaded. It also kills the UNDO history.

I will still try to find a solution which works with .bak file management...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sometimes when Comparer incorrectly matches "equal" lines I press Compare for fixing that by rematching lines (for example, after adding some null lines to one file). And Compare button allows for me to see how files will be compared next time I run Comparer. So, I make changes and see results immediately.

I tried to use Save button directly, there is no bug, Save works. But when I use Compare button once for saving, next time when I want to save file neither Compare nor Save button don't works until I close Comparer and open it again.

Is there a way to keep undo history between Compare button presses?

Why Compare button causes troubles with .bak management? When I press Compare button, TC should Save file(s) and Reload them, I don't see any conflicts here.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48121
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I think that I found a solution now. However, you will get two backup files then, .bak and .bk2. The first will be the state of the file before editing started, and the second the state before the last editing step. This is necessary because large files are mapped into memory, which has to be the .bak file for several reasons.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

That's good. But if we'll have two temp files, we have even more need to keep them in temp folder as people suggested (me too). :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48121
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately the temp folder isn't necessarily on the same harddisk, so this wouldn't work.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author) wrote:Unfortunately the temp folder isn't necessarily on the same harddisk, so this wouldn't work.
Why? We should just make a backup copy in temp folder and map original file. I don't see here any troubles.

BTW, backup creating between different logical drives not slower than in the same folder.

I'd always hated thumbs.dat files that litter folders. What about you?
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2MVV
I just updated this script to work with the current beta:
AutoHotkey: Auto-Delete BAK-files created by TC's File-Compare-Editor
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

StatusQuo wrote:I just updated this script to work with the current beta:
AutoHotkey: Auto-Delete BAK-files created by TC's File-Compare-Editor
Maybe it's good but I think TC should support .bak creating disabling itself. It is more surely. :roll:
If I need a tool for removing backups, I'd write such tool in C/C++ (with multiple windows support, changing compared files w/o closing compare dialog etc.).
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

MVV wrote:If I need a tool for removing backups, I'd write such tool in C/C++ (with multiple windows support, changing compared files w/o closing compare dialog etc.).
Go for it! ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48121
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, the original error of this bug report should be fixed now...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Original problem fixed, checked in b8. But now after compare-and-edit TC leaves up to FOUR backup files... Needs to hold them in special folder even more:)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48121
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, thanks for confirming the fix! Sorry, the 4 backup files cannot be avoided.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I do not suggest to avoid them, I (and nort only) suggest to keep them in user-specified garbage folder.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

The only issue with the Compare tool that I've run into on more than one occasion is I use .bak frequently to make backups of source code within the same file's directory. When running CompareFile tool against 2 files, and making any changes + save. TC will happily overwrite the existing .bak that it didn't create and with no confirmation warning that it is going to do so.

This wouldn't occur if TC's "temp" backups were named along the lines of FileName.ext.tc.bak or FileName.ext.tc.bk1, etc.

Or if it made a .bk1 for its initial save if an there was a pre-existing .bak
Post Reply