Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# parchive / quickpar / par2 repair implementation?

Tags:

c#

repair

I'm writing a C# app that needs to be able to repair a set of files using par2 parity files. For C++ there is lots to be found that'll do exactly that, but for C# I can't find a native implementation.

One option would be using a C++ DLL from C#, but I'd rather not do that since it's not possible to use a 32bits dll in an x64 app so I'd be limiting my app to 32bits mode.

Another option is to shellexecute par2cmdline in the background, but I'd rather have more control over the process (progress, cancelling etc.).

Does anyone know of a native C# implementation that'll repair files using a par2 set ?

like image 657
Led Avatar asked May 19 '09 08:05

Led


People also ask

Bahasa C digunakan untuk apa?

Meskipun C dibuat untuk memprogram sistem dan jaringan komputer namun bahasa ini juga sering digunakan dalam mengembangkan software aplikasi. C juga banyak dipakai oleh berbagai jenis platform sistem operasi dan arsitektur komputer, bahkan terdapat beberepa compiler yang sangat populer telah tersedia.

C dalam Latin berapa?

C adalah huruf ketiga dalam alfabet Latin. Dalam bahasa Indonesia, huruf ini disebut ce (dibaca [tʃe]).

Bahasa C dibuat pertama kali oleh siapa dan tahun berapa?

Bahasa pemrograman C ini dikembangkan antara tahun 1969 – 1972 oleh Dennis Ritchie. Yang kemudian dipakai untuk menulis ulang sistem operasi UNIX. Selain untuk mengembangkan UNIX, bahasa C juga dirilis sebagai bahasa pemrograman umum.


1 Answers

Do you want to stick with PARs themselves? I have a fully native Reed/Solomon implimentation I would post if it will help (the match that PARs are based on), but I don't have anything for all the file handling and breakup.

My code is an implementation of Stream and produces a string with all the error correcting data included. You can then corrupt that data and send it back and it system will automatically recover it. I would just post it but it is long and I am too lazy to make a blog post and link to it.

To make that work like PAR, you would have to break that up into files, then build a system that can identify missing volumes and 'adds in' corrupt data for all the missing data (the math cannot handle missing data, only corrupt).

Also, as a note on performance, the system this was built for was rather 'bursty', it would get in lots of 100k streams at a time, but also have long waits of doing nothing. The C# version of the math worked about 6% faster then the pure C version. If I did performance testing using just non-stop load, the C# runs about 1-2% slower. In my experience, most C to C# math conversions have the same performance results.

like image 99
JasonRShaver Avatar answered Sep 19 '22 05:09

JasonRShaver