File-Compare, Editmode: Backup destroys NTFS File-Hardlinks
Moderators: white, Hacker, petermad, Stefan2
File-Compare, Editmode: Backup destroys NTFS File-Hardlinks
In the Edit-Mode of the File-Compare-Function there is a backup-function which creates file-backup of altered files. This renames the old/existing file to *.bak, then creates a new file with the original/old file name.
This may be safe and recommended by Micros*ft - but it destroys existing NTFS Hardlinks:
If file.ext previously was hardlinked to some other files and you use the Editmode in File-Compare, then the linked file gets renamed, so after the action "file.ext.bak" will be the linked file, while "file.ext" has no hardlinks anymore.
MS Offi*e behaves the same way - but that doesn't necessarily have to be a good example...
If that is "by design" and remain this way:
- Is there already a way to turn off the creation of backup files, which leaves the existing hardlinks functional? (if not: please add)
- Maybe the way of creating the backup files can (optionally) be turned around
(copy the altered file to "*.*.bak" and then change the contents in the original file)?
This may be safe and recommended by Micros*ft - but it destroys existing NTFS Hardlinks:
If file.ext previously was hardlinked to some other files and you use the Editmode in File-Compare, then the linked file gets renamed, so after the action "file.ext.bak" will be the linked file, while "file.ext" has no hardlinks anymore.
MS Offi*e behaves the same way - but that doesn't necessarily have to be a good example...
If that is "by design" and remain this way:
- Is there already a way to turn off the creation of backup files, which leaves the existing hardlinks functional? (if not: please add)
- Maybe the way of creating the backup files can (optionally) be turned around
(copy the altered file to "*.*.bak" and then change the contents in the original file)?
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
Yes, it has already been reported before:
http://ghisler.ch/board/viewtopic.php?t=12628
Unfortunately, no reply from Chris...
http://ghisler.ch/board/viewtopic.php?t=12628
Unfortunately, no reply from Chris...
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Support - I would pefer not to have the backup either - If I want a backup, I can make it myself before I compare the files.Is there already a way to turn off the creation of backup files,....? (if not: please add)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
To preserve the hardlink you have do on a save event:I don't see how I could preserve them.
1. copy FILENAME.EXT to FILENAME.BAK
2. save FILENAME.EXT by overwriting original.
This lets the hardlinked object still be the original and gives you the possibility to copy the backup over it in case of fallback needs
#5767 Personal license
ghisler(Author)
And in addition to the two posts above, the methods suggested could be implemented as options.
And in addition to the two posts above, the methods suggested could be implemented as options.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Wow, how efficient. I know of no other program which does this!1. copy FILENAME.EXT to FILENAME.BAK
2. save FILENAME.EXT by overwriting original.
One idea would be to just copy the alternate NTFS streams to the new file. Would this be OK too?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
You can make this behaviour optional. For example, I personally never edit/save files > 1 MB in the Compare by Content window, but NTFS streams, NTFS hard links, read-only/hidden/etc attributes and so on, and so forth - all these features are quite important for me. So, I would prefer to wait additional 0,1-0,2 seconds when saving the file and keep all the attributes mentioned.ghisler(Author) wrote:Wow, how efficient.
On the contrary, someone may like to edit all files (including huge ones) when comparing with other similar files, but he uses FAT32, does not use read-only/hidden attributes - he would prefer that TC saves backups more efficiently.
An option would be the best solution in this case. IMHO, of course.
NTFS hard links (not junctions) will not be managed correctly in this case, unfortunately...ghisler(Author) wrote:One idea would be to just copy the alternate NTFS streams to the new file. Would this be OK too?
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Maybe one step more, but the only way I know how to preserve hardlinks.ghisler(Author) wrote:Wow, how efficient.
You may ask the author of PSPad (support at pspad dot com) for a hint about the used procedure ...Horst.Epp wrote:Any good editor like PSpad does it to preserve ACLs and Ownership of the original file.
#5767 Personal license
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I will check whether it's possible. There is one big problem with files mapped into memory (used for large files), but I think that it should be solvable.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Fixed in TC7 rc2, hardlinks keep existing/working after saving changes in Filecompare / Editmode.
What about the wish of making this backup-file-creation optional?
Backups may be advisable in some cases, but I'd really like to turn that off for normal everyday-use. I already have enough backups of important files or can make them myself before editing...
A checkbox in the GUI would probably be more than needed, an option in wincmd.ini would be enough for me.
Will you implement this? Please...
What about the wish of making this backup-file-creation optional?
Backups may be advisable in some cases, but I'd really like to turn that off for normal everyday-use. I already have enough backups of important files or can make them myself before editing...
A checkbox in the GUI would probably be more than needed, an option in wincmd.ini would be enough for me.
Will you implement this? Please...
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
HTHCompareSaveOriginal=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.
2Hacker:
Thanks for the hint, but that's not what I meant. This seems to only switch the way the backup files are created.
I would like to not have any backup at all (using precious disk space and not having any advantages for me) - in most cases.
Thanks for the hint, but that's not what I meant. This seems to only switch the way the backup files are created.
I would like to not have any backup at all (using precious disk space and not having any advantages for me) - in most cases.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!