RarArchiveEntry Class
An entry of a RAR archive: a file, a directory, or a link. An entry whose data are split between volumes is one entry. The entries of RarArchive and of the forward-only reader of RAR archives are of this type.
public sealed class RarArchiveEntry : ArchiveEntry- Inheritance
ArchiveEntryRarArchiveEntry
Properties
| Name | Description |
|---|---|
| Archive | Gets the archive of the entry, or null for an entry of the forward-only reader (its content can be read only while it is the current entry of the reader). |
| Attributes | Gets the Windows attributes of the entry, for an entry created on Windows, MS-DOS or OS/2. |
| Blake2spHash | Gets the BLAKE2sp hash (32 bytes) of the content of the entry, or an empty value when the archive does not store it, when it stores a hash that depends on the encryption key, or when the header of the last part of an entry split between volumes is not read yet (in the forward-only reader). |
| CompressedLength | Gets the length of the compressed data of the entry, in all its volumes. In the forward-only reader, the length of the parts of an entry split between volumes is known once its content is read. |
| CompressionMethod | Gets the compression method: 0 for stored data, 1 (fastest) to 5 (best) for compressed data. |
| CompressionVersion | Gets the version of the compression algorithm: 15, 20, 26, 29 or 36 for the archives of RAR 1.5-4.x (RAR 1.5, 2.0, 2.6, 2.9), 50 for the RAR 5.0 algorithm and 70 for the RAR 7.0 algorithm. |
| Crc32 | Gets the CRC-32 of the content of the entry, or null when the archive does not store it (a RAR5 archive may store a BLAKE2sp hash instead), when it stores a CRC that depends on the encryption key, or when the header of the last part of an entry split between volumes is not read yet (in the forward-only reader). |
| CreationTime | Gets the time the entry was created, or null when the archive does not store it. |
| DictionarySize | Gets the size of the dictionary of the compression, or 0 for a directory. |
| FullName | Gets the path of the entry in the archive, with / separators. A version of a file archived with the -ver switch of RAR has the suffix ;N where N is its version number, as in the listing of unrar. |
| HardLinkTarget | Gets the path of the entry whose content this entry shares: the target of a hard link or of a file copy of RAR5, or null. RarArchiveEntry.Open returns the content of the target in a RarArchive, and an empty stream in the forward-only reader. |
| HostAttributes | Gets the raw attributes of the entry: Windows attributes or a Unix mode, depending on RarArchiveEntry.HostOperatingSystem. |
| HostOperatingSystem | Gets the operating system that created the entry, which defines the meaning of its attributes. |
| IsDirectory | Gets a value indicating whether the entry is a directory. |
| IsEncrypted | Gets a value indicating whether the content of the entry is encrypted. |
| IsSolid | Gets a value indicating whether the entry continues the compression dictionary of the previous entry (a solid archive). |
| LastAccessTime | Gets the last time the entry was accessed, or null when the archive does not store it. |
| LastWriteTime | Gets the last time the entry was modified, or null when the archive does not store it. |
| Length | Gets the length of the content of the entry: 0 for a directory, -1 when the archive does not store it. For a link of RAR5, it is the length the archive records (the length of the target), while RarArchiveEntry.Open returns an empty stream for a symbolic link. |
| LinkTarget | Gets the target of a symbolic link (a Unix or Windows symbolic link, or a Windows junction of RAR5, a Unix symbolic link of RAR 1.5-4.x), or null. The separators are /; the target of a junction is absolute. For a link of RAR 1.5-4.x, the target is the content of the entry, read on the first access. |
| UnixFileMode | Gets the Unix permissions of the entry, for an entry created on Unix. |
Archive
RarArchiveEntry.csGets the archive of the entry, or null for an entry of the forward-only reader (its content can be read only while it is the current entry of the reader).
public RarArchive? Archive { get; }Property value
Attributes
RarArchiveEntry.csGets the Windows attributes of the entry, for an entry created on Windows, MS-DOS or OS/2.
public override FileAttributes? Attributes { get; }Property value
Blake2spHash
RarArchiveEntry.csGets the BLAKE2sp hash (32 bytes) of the content of the entry, or an empty value when the archive does not store it, when it stores a hash that depends on the encryption key, or when the header of the last part of an entry split between volumes is not read yet (in the forward-only reader).
public ReadOnlyMemory<byte> Blake2spHash { get; }Property value
CompressedLength
RarArchiveEntry.csCompressionMethod
RarArchiveEntry.csCompressionVersion
RarArchiveEntry.csCrc32
RarArchiveEntry.csGets the CRC-32 of the content of the entry, or null when the archive does not store it (a RAR5 archive may store a BLAKE2sp hash instead), when it stores a CRC that depends on the encryption key, or when the header of the last part of an entry split between volumes is not read yet (in the forward-only reader).
public override uint? Crc32 { get; }Property value
CreationTime
RarArchiveEntry.csGets the time the entry was created, or null when the archive does not store it.
public override DateTimeOffset? CreationTime { get; }Property value
DictionarySize
RarArchiveEntry.csFullName
RarArchiveEntry.csHardLinkTarget
RarArchiveEntry.csGets the path of the entry whose content this entry shares: the target of a hard link or of a file copy of RAR5, or null. RarArchiveEntry.Open returns the content of the target in a RarArchive, and an empty stream in the forward-only reader.
public override string? HardLinkTarget { get; }Property value
HostAttributes
RarArchiveEntry.csGets the raw attributes of the entry: Windows attributes or a Unix mode, depending on RarArchiveEntry.HostOperatingSystem.
public uint HostAttributes { get; }Property value
HostOperatingSystem
RarArchiveEntry.csGets the operating system that created the entry, which defines the meaning of its attributes.
public RarHostOperatingSystem HostOperatingSystem { get; }Property value
IsDirectory
RarArchiveEntry.csIsEncrypted
RarArchiveEntry.csIsSolid
RarArchiveEntry.csLastAccessTime
RarArchiveEntry.csGets the last time the entry was accessed, or null when the archive does not store it.
public override DateTimeOffset? LastAccessTime { get; }Property value
LastWriteTime
RarArchiveEntry.csGets the last time the entry was modified, or null when the archive does not store it.
public override DateTimeOffset? LastWriteTime { get; }Property value
Length
RarArchiveEntry.csGets the length of the content of the entry: 0 for a directory, -1 when the archive does not store it. For a link of RAR5, it is the length the archive records (the length of the target), while RarArchiveEntry.Open returns an empty stream for a symbolic link.
public override long Length { get; }Property value
LinkTarget
RarArchiveEntry.csGets the target of a symbolic link (a Unix or Windows symbolic link, or a Windows junction of RAR5, a Unix symbolic link of RAR 1.5-4.x), or null. The separators are /; the target of a junction is absolute. For a link of RAR 1.5-4.x, the target is the content of the entry, read on the first access.
public override string? LinkTarget { get; }Property value
UnixFileMode
RarArchiveEntry.csGets the Unix permissions of the entry, for an entry created on Unix.
public override UnixFileMode? UnixFileMode { get; }Property value
Methods
| Name | Description |
|---|---|
| Open() | Opens the content of the entry. The stream checks the CRC or the hash the archive stores, and throws an InvalidDataException at its end when they do not match. |
Open()
RarArchiveEntry.csOpens the content of the entry. The stream checks the CRC or the hash the archive stores, and throws an InvalidDataException at its end when they do not match.
public override Stream Open()Returns
Stream A read-only stream of the content of the entry.
Exceptions
InvalidDataException- The archive is corrupted.
ArchivePasswordException- The entry is encrypted and the password is missing or wrong.
NotSupportedException- The entry is compressed or encrypted with a method that is not supported.