RAR archives - Cannot get volume number #529

Closed
opened 2026-01-29 22:13:22 +00:00 by claunia · 2 comments
Owner

Originally created by @lchegde on GitHub (Jun 22, 2022).

Is it possible to read the internal volume number for each file in a multi volume archive?
I cannot find this information for RarArchive presently, is this information available using sharpCompress?

If not, is this something that could be supported?

Example from rar.exe ls, showing the volume number in question for a couple of volume files in the same archive:

Archive: <rar-file first volume>
Details: RAR 5, volume 1

 Attributes      Size     Date    Time   Name
----------- ---------  ---------- -----  ----
 -rw-r--r--   1161022  2022-04-24 07:12  filename.jpg
 -rw-r----- 1641030031  2022-04-24 07:10  filename.mp4
----------- ---------  ---------- -----  ----

Archive: <rar-file second volume>
Details: RAR 5, volume 2

 Attributes      Size     Date    Time   Name
----------- ---------  ---------- -----  ----
 -rw-r----- 1641030031  2022-04-24 07:10  filename.mp4
----------- ---------  ---------- -----  ----

Originally created by @lchegde on GitHub (Jun 22, 2022). Is it possible to read the internal volume number for each file in a multi volume archive? I cannot find this information for RarArchive presently, is this information available using sharpCompress? If not, is this something that could be supported? Example from `rar.exe ls`, showing the volume number in question for a couple of volume files in the same archive: ``` Archive: <rar-file first volume> Details: RAR 5, volume 1 Attributes Size Date Time Name ----------- --------- ---------- ----- ---- -rw-r--r-- 1161022 2022-04-24 07:12 filename.jpg -rw-r----- 1641030031 2022-04-24 07:10 filename.mp4 ----------- --------- ---------- ----- ---- Archive: <rar-file second volume> Details: RAR 5, volume 2 Attributes Size Date Time Name ----------- --------- ---------- ----- ---- -rw-r----- 1641030031 2022-04-24 07:10 filename.mp4 ----------- --------- ---------- ----- ---- ````
claunia added the enhancementup for grabs labels 2026-01-29 22:13:22 +00:00
Author
Owner

@adamhathcock commented on GitHub (Jun 22, 2022):

it's possible but it's not that simple. An entry can be spread across multiple volumes. The data is in the FilePart classes and could be exposed somehow: https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Rar/RarFilePart.cs

@adamhathcock commented on GitHub (Jun 22, 2022): it's possible but it's not that simple. An entry can be spread across multiple volumes. The data is in the FilePart classes and could be exposed somehow: https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Rar/RarFilePart.cs
Author
Owner

@Nanook commented on GitHub (Jul 17, 2022):

https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/IEntry.cs

Now has the first and last volume index. This index can be used to get the files filenames using archive.Volumes[index].FileName

@Nanook commented on GitHub (Jul 17, 2022): https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/IEntry.cs Now has the first and last volume index. This index can be used to get the files filenames using archive.Volumes[index].FileName
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#529