This project is read-only.

Extract only one file within archive (without filepath)

Nov 19, 2014 at 10:02 PM

After feedling around with this lib, i've tried to extract for a 7z archive one file only using:

Dim archive As New SevenZipArchive("d:\static.7z", ArchiveFormat._7z)
Using archive
            Dim entries = From entry In archive
                           Where Not entry.IsDirectory And entry.FileName.Contains("tate") And     entry.FileName.EndsWith(".exe")
                          Select entry

            entries.ExtractAll( "d:\tate.exe", ExtractOptions.OverwriteExistingFiles)
End Using

Unfortunately, if the file is behind several subfolders within the archive, the folder structure is replicated by the extraction process.

Any idea on how to extract the file only, without the folder structure ?