This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

unpacking from damaged archives does delete existing file

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed Printable version
View previous topic :: View next topic  
Author Message
TW
Senior Member
Senior Member


Joined: 19 Jan 2005
Posts: 313

PostPosted: Sat Nov 05, 2016 11:46 am    Post subject: unpacking from damaged archives does delete existing file Reply with quote

steps:

- download http://www.voidtools.com/Everything-1.4.1.793b.x86.zip
- unpack it to dir "test"
- download http://vicebuilds6.bplaced.net/rebuilt.Everything-1.4.1.788b.x86.zip
- unpack Everything.lng from second (damaged) archive to dir "test"

TC now wants to overwrite the file, but fails because the archive is broken. but the target file in "test" gets deleted.
_________________
licenced and happy TC user since 1994 (#11xx)
Back to top
View user's profile Send private message
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7184
Location: Valsted, Denmark

PostPosted: Sat Nov 05, 2016 12:44 pm    Post subject: Reply with quote

Confirmed ! Rolling Eyes The target file gets deleted if I chose "Cancel" and it gets partly written if I chose "OK"
_________________
#524
Danish Total Commander Translator
TC 9.10b1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.81b8 on Android 6.0

Get Extended Total Commander Menus


Last edited by petermad on Sat Nov 05, 2016 12:53 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Horst.Epp
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 2587
Location: Germany

PostPosted: Sat Nov 05, 2016 12:49 pm    Post subject: Reply with quote

For me this is logical from a programmers view.
Why should TC fully read a source archive
before starting to write into the target ?
And how should it recover from the error ?
_________________
Windows 10 x64 Version 1709 (OS Build 16299.19)
Fall Creators Update
TC 9.10RC3 x64 and x86
Back to top
View user's profile Send private message
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7184
Location: Valsted, Denmark

PostPosted: Sat Nov 05, 2016 12:56 pm    Post subject: Reply with quote

2Horst.Epp
Quote:
Why should TC fully read a source archive
before starting to write into the target ?

I guess you are right, otherwise TC should always write to a temp file first and then replace the target, and that would be very time consuming - but it is not fun loosing data like that!
_________________
#524
Danish Total Commander Translator
TC 9.10b1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.81b8 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7861
Location: Russian Federation

PostPosted: Sat Nov 05, 2016 1:41 pm    Post subject: Reply with quote

It is not only TC, but most archivers remove such partially extracted files. And of course before starting extraction existing file gets deleted (overwrite is delete and then put new one).
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5597
Location: Meiningen (Südthüringen)

PostPosted: Sat Nov 05, 2016 1:55 pm    Post subject: Reply with quote

It's only data loss if TC wouldn't ask whether to overwrite existing files. But TC does so, doesn't it? I admit that TC9 behaves differently than TC8 by deleting the partially extracted files.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
TW
Senior Member
Senior Member


Joined: 19 Jan 2005
Posts: 313

PostPosted: Sat Nov 05, 2016 2:02 pm    Post subject: Reply with quote

well, winrar asks as well before overwriting, and still there is no data loss. winrar complains about CRC error and then halts.

also it is new to me that when overwriting a file the old one gets deleted before copying/moving the new file.

i agree, this is a rare case and it doesn't me worry personally. i just posted it because this really happened to me with above files, but it was not a real loss of course.
_________________
licenced and happy TC user since 1994 (#11xx)
Back to top
View user's profile Send private message
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7184
Location: Valsted, Denmark

PostPosted: Sat Nov 05, 2016 2:52 pm    Post subject: Reply with quote

Quote:
It's only data loss if TC wouldn't ask whether to overwrite existing files. But TC does so, doesn't it? I admit that TC9 behaves differently than TC8 by deleting the partially extracted files.


TC first to ask to overwrite the file, simply just because it exists, Then it comes up with this:
Quote:
---------------------------
rebuilt.Everything-1.4.1.788b.x86.zip
---------------------------
Disk read error!
---------------------------
OK Annuller
---------------------------

If I press OK, TC deletes the existing file and writes the part of the file from the archive that is can read (in this case about half of the file).

If I press Annuller (Cancel), TC simply just deletes the existing file.

This behaviour is the same in TC9.0rc4 and TC8.52a.
_________________
#524
Danish Total Commander Translator
TC 9.10b1 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.81b8 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5597
Location: Meiningen (Südthüringen)

PostPosted: Sat Nov 05, 2016 3:33 pm    Post subject: Reply with quote

I still don't see any data loss. TC deletes the existing files only after confirming the overwrite dialog, so you already told TC to overwrite existing files (saying that you're OK with losing the existing files). If the unpacking would have been successful, the files would have been replaced, right? In either case (unpack operation successful or not), the existing files are gone, either deleted or overwritten by the unpack operation.

But you're right that TC9 behaves the same as TC8; I was misled by my tests. Still, TC9 deletes the existing files as soon as you tell it to overwrite it, regardless of how you dismiss the (Disk read) error dialog afterwards - and TC8 did/does exactly the same, as well as WinRAR.

I don't know where you'd lose any data Confused. Maybe someone can enlighten me.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34310
Location: Switzerland

PostPosted: Mon Nov 07, 2016 8:43 am    Post subject: Reply with quote

The same happens when you copy a file from a network share, overwriting a local file, and the network goes down. There isn't really much I can do - I could make a backup of the local file first, or download/copy to a different name, but these all have their downsides too:
1. A backup takes extra space which may not be there on e.g. a USB stick, or take a long time for e.g. a big movie.
2. Downloading to a different name would lose externded rights and/or extra streams of the local file.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bwh
Junior Member
Junior Member


Joined: 30 May 2006
Posts: 11

PostPosted: Sun Jan 15, 2017 6:32 pm    Post subject: Reply with quote

This seems similar to something that was fixed for rar back in the day unless I'm misunderstanding (http://ghisler.ch/board/viewtopic.php?t=24544)
Back to top
View user's profile Send private message
mifritscher
Junior Member
Junior Member


Joined: 14 Oct 2015
Posts: 5

PostPosted: Sun Feb 26, 2017 11:50 am    Post subject: Reply with quote

In some situations, a temp file can't be created (because of space constraints). An idea would be to have a option "test read the source before actual copying" or having a test read function in general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group