Page 1 of 2

Special folder for backup files created by Compare&Edit

Posted: 2010-04-25, 16:49 UTC
by MVV
I suggest to add new INI option named like 'CompareSaveBackupFolder'. If it is not specified, internal comparer saves backup files as now near modified file. But if CompareSaveBackupFolder points to some folder, internal comparer saves backup files to that folder.

To keep file index (and hard copies) TC needs to copy file with new name %N.bak to make backup (and it does it with CompareSaveOriginal=1) - and it doesn't matter at all where to put backup file (same folder/same drive/any special folder) since it will be always copy operation. But it will be great if TC put backup files into special place for backups and not to leave garbage in source folder (it is not so hard to get backup from special folder when needed).

Also such key will allow TC to work normally if source folder is write-protected but compared and edited file has full permissions since TC won't try to add new file into protected folder, just modify existing one.

And, such option doesn't require localization, just few lines in help file. :)

(I think it was discussed some times but I coudn't find topic)

Posted: 2010-04-26, 15:16 UTC
by petermad
Support++

Posted: 2010-07-20, 08:05 UTC
by MVV
Dear Christian, will TC users see this feature in TC 8.0?

- It is really uncomfortable to compare-n-edit files if one of them is write-able in write-protected folder - TC asks to save modified file into another folder so it is impossible to save modified file using original name and path so I need to save modified file into some another place and move it to original place after closing comparer.

- During multiple compare-n-edit operations TC leaves backup files in many folders where users don't require them.

So it would be much better to have theese files in one generic user-specified place (e.g. with original folder structure like f:\temp\tc_backups\e$\docs\myfile1.txt.bak or using special filename with masked path like f:\temp\_tc_backups\e$~docs~myfile1.txt.bak).
And, making backup will be even faster if backup folder is on another partition since backup is made by usual copy operation.

Posted: 2011-11-14, 07:34 UTC
by MVV
Another compare with file in write-protected folder (file has full access rights since it is INI file), and again same problem - I can't edit-and-compare it because TC won't allow to save file because of failed .bak creation....

Posted: 2011-11-14, 17:04 UTC
by ghisler(Author)
It's not that easy because .bak files are often created by just renaming the originals when saving - and that must be done on the same drive...

Posted: 2011-11-14, 18:24 UTC
by MVV
Renaming is bad idea because it breaks hardlinks and permissions, so I think better way is to copy file (there is an option to enable such backup creation already), so it doesn't matter where to copy file...

Also, you need to create a file anyway, and file is already in cache, so saving will be quick. And, filesize for edit-n-compare is not too much...

Maybe you can allow special place for backup-via-copy option only if you like fast backup-via-rename? BTW you can allow to make a backup folder for every drive (e.g. by allowing to use drive letter variable in path like in path to tree file), so move will work for backup-via-rename and copy - for backup-via-copy.

Of course, this option may be disabled by default...

Posted: 2013-09-06, 09:06 UTC
by MVV
ghisler,
Please add an option to create BAK files in temp directory for 8.50.

It is a pain to merge files in write-protected folders (wincmd.ini is one of them - I have TC folder write-protected but wincmd.ini may be written by users), every time I try to save file TC requires to save it to other place even if file is writable.

Posted: 2013-09-06, 20:35 UTC
by ghisler(Author)
This is unfortunately impossible - TC opens files for file mapping, so it needs to rename the file on the same drive.

Posted: 2013-09-07, 10:43 UTC
by MVV
It is quite easy in the mode when TC creates backup by copying. It won't take more time to save file to temporary folder anyway (same drive - same time, another drive - maybe even less time). And, it is really unlogical to save file into another folder just because temporary file can't be created in this folder...

I think many people use this mode (it is the default mode, CompareSaveOriginal=1). It keeps original file streams/permissions/hardlinks etc...

Posted: 2013-09-08, 14:55 UTC
by ghisler(Author)
There is still the problem that the two files often have the same name, so the .bak files couldn't go to the same directory.

Posted: 2013-09-08, 15:44 UTC
by MVV
But you can assign them any names, why is it a problem? Temporary files may have temporary names. :)

Posted: 2013-09-09, 13:47 UTC
by ghisler(Author)
The problem is that in case of damage, the user needs to be able to find the backup somehow...

Posted: 2013-09-09, 16:27 UTC
by MVV
You can append prefixes with date-time and left/right specifier (e.g. 2013-07-12 23:45:23:123 R file1.txt where R means initially right comparer side).
Currently when TC deletes temp files after comparison user can't recover backups more so it is the same thing.
Maybe additional flag for CompareDeleteBak key would be nice: 1 - delete, 2 - keep in temp, 3 - keep in temp and delete... Currently I use CompareDeleteBak=1 to get rid of backup files that TC creates everywhere. But with option to save them in temp folder I would use CompareDeleteBak=2 to keep backups in one place w/o instant deletion.

Posted: 2013-11-26, 09:52 UTC
by MVV
ghisler,
Do you plan to learn TC to keep backups in separate folder? I face with this restriction every time when I compare&edit *.ini in TC dir (where files are read-only except configuration ones): TC suggests to save file to another directory. It would be much better to show dialog to save backup at least but it would be much greater to do it w/o user interaction.

Posted: 2013-11-26, 17:11 UTC
by ghisler(Author)
It's on my wish list, but didn't make it into TC yet, sorry...