954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Algorithm for checking contiguous blocks

Hi

I'm trying to write a program that will work with kazaa dat files (ie the files where kazaa stores the downloaded file). Basically my problem is that i need to check if a 10MB chunk of the file has been downloaded, however kazaa stores what it has downloaded in the format:
Chunk start position and size of chunk downloaded
and the chunks areen't necessarily in the correct order. Also the chunk sizes and start positions can be fairly random.
So it might look a little like this:
0, 100 (so first 100 bytes there)
100, 100 (2nd 100 bytes there)
210, 175 (so bytes 200 - 210 are missing
485, 115
385, 100
etc

I either need to know which chunks are all there or the reverse ie which bits are missing. Does anyone have any ideas or know anywhere where i might be able to find an algorithm that could do this. My only idea was to do a bubble sort and then go through check if the end of one is the beginning of the next, but since the start position and chunk size are stored in different arrays i couldn't see how that could be done.

ilw
Newbie Poster
1 post since Jul 2003
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You