Can't get root folder in Rar #152

Closed
opened 2026-01-29 22:07:27 +00:00 by claunia · 0 comments
Owner

Originally created by @et721 on GitHub (Dec 15, 2016).

HI!

I'm trying to check if a Rar archive contains a folder, and if it does, I need to get that entry first, when i'm looping through the entries, it starts with the first file in the sub directory, I'm not very proficient in programming

using (RarArchive archive = RarArchive.Open(vManager.getActiveMod())) { foreach (RarArchiveEntry entry in archive.Entries.Where(entry => entry.IsDirectory)) { MessageBox.Show(entry.ToString()); /*entry.WriteToDirectory("D:\\temp", new ExtractionOptions() { ExtractFullPath = true, Overwrite = true }); */ } }

Originally created by @et721 on GitHub (Dec 15, 2016). HI! I'm trying to check if a Rar archive contains a folder, and if it does, I need to get that entry first, when i'm looping through the entries, it starts with the first file in the sub directory, I'm not very proficient in programming `using (RarArchive archive = RarArchive.Open(vManager.getActiveMod())) { foreach (RarArchiveEntry entry in archive.Entries.Where(entry => entry.IsDirectory)) { MessageBox.Show(entry.ToString()); /*entry.WriteToDirectory("D:\\temp", new ExtractionOptions() { ExtractFullPath = true, Overwrite = true }); */ } }`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#152