Ovewriting file from corrupted RAR-archive

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

Moderators: white, Hacker, petermad, Stefan2

bbutcher
Junior Member
Junior Member
Posts: 22
Joined: 2009-02-28, 18:48 UTC

Post by *bbutcher »

ghisler(Author) wrote:I will check whether Total Commander itself deletes the file, or the packer (WinRAR). In the first case, I will change it so the file isn't deleted. In the second case, I cannot do anything...
I think, this is a common problem of overwriting procedure.

If operation of overwriting is interrupted (user clicked on “Cancel” or problem with unread source-file - scratched CD/DVD, bad-blocks on HDD/FDD/Flash, corrupted archive etc.) target file will deleted.

Feasible solution:

1. TC ask: “Overwrite file?”. User select “Overwrite!”.
2. TC check free space in this folder.

2.1. If free space is enough:

2.1.1. Rename target-file (for example, “filename.ext” to “filename.ext.tmp”)
2.1.2. Copy source file.
2.1.3. If operation successful – delete target file, if not – restore it.

2.2. If free space is not enough (use standard overwriting operation):

2.2.1. Delete target file.
2.2.2. Copy source file.

P.S. For example, TC can do such safe overwriting only for potential defected sources (archives, CD/DVDs and FDD).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have checked it now - the problem is that the error occurs when parts of the target file have already been overwritten. I cannot simply rename the target either, because then special attributes, hard links to the file etc. would all be lost...
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:I have checked it now - the problem is that the error occurs when parts of the target file have already been overwritten. I cannot simply rename the target either, because then special attributes, hard links to the file etc. would all be lost...
BTW, hardlinks don't lost when you move a file (because file data don't moves), only when copy.

Also, I think it will be good for someone if TC in 'overwrite all older' mode will use safe method (rename original, place new, remove original if ok, or restore original if fail). Or maybe it should be some new 'update mode'.
Post Reply