[REQ]Repair files

Use this forum to flesh out your feature request before you enter it in <a href="http://dcpp.net/bugzilla/">Bugzilla</a>.

Moderator: Moderators

Locked
mpioner
Posts: 4
Joined: 2006-11-21 23:48

[REQ]Repair files

Post by mpioner » 2006-11-22 00:07

When I start downloading file to the directory where there is a file with the same name, then DC++ simply rewrite it. It would be better if it will compare
TTH of such two files and act like this:
1. TTH1 = TTH2 -> stop downloading;
2. TTH1 != (a bit) TTH2 -> download corrupted parts;
3. TTH1 != (absolutely) TTH2 -> overwrite or delete file or asking for a rename of the file
This function was very useful!

Todi
Forum Moderator
Posts: 699
Joined: 2003-03-04 12:16
Contact:

Post by Todi » 2006-11-22 03:09

If DC++ finds an identical file already existing where you are trying to download to, doesn't it simply skip the download? That's how my DC++ works, although it's an older version.

eMTee
Posts: 61
Joined: 2006-01-18 15:44
Location: Hungary

Re: [REQ]Repair files

Post by eMTee » 2006-11-22 04:52

mpioner wrote:1. TTH1 = TTH2 -> stop downloading;
Now it works like this altough the comparsion isn't done by TTH. If the file to download is equal or smaller than the existing one it won't be donwloaded and a message will be shown on the statusbar.
2. TTH1 != (a bit) TTH2 -> download corrupted parts;
3. TTH1 != (absolutely) TTH2 -> overwrite or delete file or asking for a rename of the file
There are no small and large differences between TTHs. If only 1 byte is different in 2 files then their TTH will be absolutely different. TTH is for properly identifying a file and it doesn't contain information about the contents of the file. So your 2. proposal is impossible to realize. (What is TTH -> See here)
For the 3. proposal I think so, there could be a better way. First I think the comparsion should be made by TTH and if its not the same then ask user or open a SaveDialog the way like Download to... function does.

It could be ok for a single file addition but when a folder added to the queue and more than one filename are the same as the ones existing in the same (sub)folders... :?
Everyone's got their opinions - They'll tell ya 'bout 'em all the time... /* Spock's Beard */

mpioner
Posts: 4
Joined: 2006-11-21 23:48

Post by mpioner » 2006-11-22 09:01

eMTee wrote:
2. TTH1 != (a bit) TTH2 -> download corrupted parts;
3. TTH1 != (absolutely) TTH2 -> overwrite or delete file or asking for a rename of the file
There are no small and large differences between TTHs. If only 1 byte is different in 2 files then their TTH will be absolutely different. TTH is for properly identifying a file and it doesn't contain information about the contents of the file. So your 2. proposal is impossible to realize. (What is TTH -> See here)
You're talking about Tiger hash (md5, svf), but here is Tiger !!!Tree!!! Hash... it splits the file in segments and calculates hash for each of segments and final hash consists of the sum of that hashes. That's why it's real to make feature (repair) that i'm talking about. Direct++ can do this, but it's not very suit.
http://en.wikipedia.org/wiki/Tiger-Tree_Hash
For the 3. proposal I think so, there could be a better way. First I think the comparsion should be made by TTH and if its not the same then ask user or open a SaveDialog the way like Download to... function does.
It could be ok for a single file addition but when a folder added to the queue and more than one filename are the same as the ones existing in the same (sub)folders... :?
I think it'll be better to make it like in files managers (i.e. Total Commander)

eMTee
Posts: 61
Joined: 2006-01-18 15:44
Location: Hungary

Post by eMTee » 2006-11-22 11:57

Now you unfolded what you mean (corrupted parts == segments containing corrupted data) and this way the idea is much closer to reality. Btw. (original) DC++ has no segment download capability so may your idea would be sooner realized by some mod developers (if it haven't been implemented yet)
I think it'll be better to make it like in files managers (i.e. Total Commander)
Many ideas are possible to make but you know the more your proposal can be built on the existing code of the application the sooner it will be made by the author :)
So its a good practice to offer your improvement in a way the author likes it as well... :D
Everyone's got their opinions - They'll tell ya 'bout 'em all the time... /* Spock's Beard */

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-11-22 12:03

about #3: if a TTH of an existing file has to be calculated before i download a file, it might take a long time... what if the existing file size is like 2 GB?

eMTee
Posts: 61
Joined: 2006-01-18 15:44
Location: Hungary

Post by eMTee » 2006-11-22 12:11

Right. Maybe this is the exact reason why its done by filesize compare.
Everyone's got their opinions - They'll tell ya 'bout 'em all the time... /* Spock's Beard */

mpioner
Posts: 4
Joined: 2006-11-21 23:48

Post by mpioner » 2006-11-25 12:08

eMTee wrote:Now you unfolded what you mean (corrupted parts == segments containing corrupted data) and this way the idea is much closer to reality. Btw. (original) DC++ has no segment download capability so may your idea would be sooner realized by some mod developers (if it haven't been implemented yet)
You misunderstood me. There is no need for segment file downloading of entire file. DC++ may download segments with corrupted data now, but I have to edit Queue.xml for that purpose.
I think it'll be better to make it like in files managers (i.e. Total Commander)
Many ideas are possible to make but you know the more your proposal can be built on the existing code of the application the sooner it will be made by the author :)
So its a good practice to offer your improvement in a way the author likes it as well... :D
:D
poy wrote:about #3: if a TTH of an existing file has to be calculated before i download a file, it might take a long time... what if the existing file size is like 2 GB?
eMTee wrote:Right. Maybe this is the exact reason why its done by filesize compare
File size checking is pretty good, but dialog with Rename, Rewrite, Check TTH options is much better!

eMTee
Posts: 61
Joined: 2006-01-18 15:44
Location: Hungary

Post by eMTee » 2006-11-25 13:09

mpioner wrote:but I have to edit Queue.xml for that purpose.
What attribute? And how?
Everyone's got their opinions - They'll tell ya 'bout 'em all the time... /* Spock's Beard */

mpioner
Posts: 4
Joined: 2006-11-21 23:48

Post by mpioner » 2006-11-26 10:53

I am sorry, I mistaken. edit Queue.xml it is necessary for strongDC++ only, for original DC++ more simply.
that I do:
I search for the original file ( not corrupted ) in dc++ and begin its download, as soon as downloading began, I set priority on pause and exit from program. Then I move to Temp folder ( temp for dc++) and search files in such format name.hash and replace downloaded files with my file ( corrupted ) . Then I run dc++ again and set priority to normal, DC++ will redownload broken parts of my corrupted file

Locked