This project is read-only.


RarArchive.Open(string) leaves Streams open


That's my code:

string source = @"d:\MyProjects\ConsoleApplication1\Data\0105-exchange-betta-3.rar"; string destination = @"d:\MyProjects\ConsoleApplication1\Data\Output";

RarArchive archive = RarArchive.Open(source);
foreach (RarArchiveEntry entry in archive.Entries)
            string path = Path.Combine(destination, Path.GetFileName(entry.FilePath));
            entry.ExtractToFile(path, true);


The programm fails on last line: File.Delete(source); "The process can't get access to file..."

Is there a way to delete archive after unraring?
Closed Nov 30, 2013 at 8:38 AM by adamhathcock


gera_b wrote Apr 1, 2013 at 7:31 AM

Still got this issue in 1.0.1 version.

adamhathcock wrote Apr 1, 2013 at 9:25 AM

Try sharpcompress

gera_b wrote Apr 1, 2013 at 4:34 PM

sharpcompress have same problem )))

adamhathcock wrote Apr 2, 2013 at 10:30 AM

You need to dispose the RarArchive object. Put it in a using block.

gera_b wrote Apr 2, 2013 at 3:30 PM

That works! Amazing, thank you, Adam!

Kiwifranky wrote Nov 29, 2013 at 8:25 PM

Am I missing something?

RarArchive doesn't implement iDisposable and cannot be put in a using block.

Please Help!