Disable creation of .bak files with compare?
Moderators: Hacker, petermad, Stefan2, white
Disable creation of .bak files with compare?
Hello,
Is there any way to disable the automatic creation of .bak files when using the Edit mode in the Compare by content function?
Thanks,
jpbosk
Is there any way to disable the automatic creation of .bak files when using the Edit mode in the Compare by content function?
Thanks,
jpbosk
Hello jpbosk,
wincmd.ini
[Configuration]
HTH
Roman
wincmd.ini
[Configuration]
Code: Select all
CompareSaveOriginal=1
1: When saving, the file is copied to filename.bak, then the data is written to filename. Advantage: additional streams, special attributes etc. are preserved.
0: When saving, the data is written to filename.tmp, then the file is renamed to filename.bak, and finally filename.tmp is renamed to filename. Advantage: The file has to be written only once, and remains intact in case of a write error.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Well, if I read correctly there will be a .bak created in both ways?

I'm looking for a way to get rid of those .bak files1: When saving, the file is copied to filename.bak, then the data is written to filename. Advantage: additional streams, special attributes etc. are preserved.
0: When saving, the data is written to filename.tmp, then the file is renamed to filename.bak, and finally filename.tmp is renamed to filename. Advantage: The file has to be written only once, and remains intact in case of a write error.

- ghisler(Author)
- Site Admin
- Posts: 50934
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
No, you cannot get rid of them, sorry. While editing (and repeated saving), they are needed as a base for undo operations. They are also kept for the case of data loss.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
Is it possible to create an extra setting for CompareSaveOriginal in wincmd.ini? Like:
I'm using this feature sometimes to compare code files with are already under SVN version control. So, in case of an error, I don't really care about the data loss, I will get it from SVN again (would be nice if I was warned by Total Commander when something goes wrong of course
)
Code: Select all
2: When saving, the data is written to filename and no backup or temporary files are created. Advantage: no backup files and no temporary files. Disadvantage: no backup, no undo, use with care, only for power users, no warranty, possible data loss!

Currently the only thing you can do is to tell TC to remove backup files after comparing. You need TC8 and [Configuration] CompareDeleteBak=1 parameter. But anyway TC creates backup files near original ones.green_fr wrote:I think this request was not treated yet — is it still not possible to disable .bak files creating ?
- ghisler(Author)
- Site Admin
- Posts: 50934
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The .bak files are necessary because in some cases, TC maps the file into memory to get the unchanged lines. When the user saves the file, the original lines would be lost, therefore TC will then map the .bak file into memory. The old lines are necessary for the editor to use the "Undo" function. That's why the compare tool can only delete the .bak files when closing, because the original lines are no longer needed then.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
It would be perfect to create backup files in temp folder as it was suggested many times, there are a lot of reasons (no problems with write-protected folders when only specific files are writeable; no garbage is created in working directories; no need to have CompareDeleteBak=1 because one may want to access backup files after closing compare dialog - they may be accessed from temp folder then).
- ghisler(Author)
- Site Admin
- Posts: 50934
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem is that when you have multiple drives, the TEMP folder may be on a different drive, which could cause many new problems.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Christian, I can't see any problem here. Anyway you will need to copy file in order to create backup, so it doesn't matter where to place this copy. So it won't slow process down if temp folder is on another volume. Really it may even improve backup creation speed e.g. if compared file is in network or on slow drive while temp folder is usually on fast drive (you may even provide an option to set folder for such backup files and use some default one like %TEMP%\_tc_bak).