126 lines
3.9 KiB
C#
126 lines
3.9 KiB
C#
using System;
|
|
using AMWD.Common.Packing.Tar.Utils;
|
|
|
|
namespace AMWD.Common.Packing.Tar.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// See "struct star_header" in <a href="https://www.gnu.org/software/tar/manual/html_node/Standard.html" />
|
|
/// </summary>
|
|
public interface ITarHeader
|
|
{
|
|
/// <summary>
|
|
/// The name field is the file name of the file, with directory names (if any) preceding the file name,
|
|
/// separated by slashes.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>name</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>0</c>
|
|
/// </remarks>
|
|
string FileName { get; set; }
|
|
|
|
/// <summary>
|
|
/// The mode field provides nine bits specifying file permissions and three bits to specify
|
|
/// the Set UID, Set GID, and Save Text (sticky) modes.
|
|
/// When special permissions are required to create a file with a given mode,
|
|
/// and the user restoring files from the archive does not hold such permissions,
|
|
/// the mode bit(s) specifying those special permissions are ignored.
|
|
/// Modes which are not supported by the operating system restoring files from the archive will be ignored.
|
|
/// Unsupported modes should be faked up when creating or updating an archive; e.g.,
|
|
/// the group permission could be copied from the other permission.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>mode</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>100</c>
|
|
/// </remarks>
|
|
int Mode { get; set; }
|
|
|
|
/// <summary>
|
|
/// The uid field is the numeric user ID of the file owners.
|
|
/// If the operating system does not support numeric user ID, this field should be ignored.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>uid</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>108</c>
|
|
/// </remarks>
|
|
int UserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The gid fields is the numeric group ID of the file owners.
|
|
/// If the operating system does not support numeric group ID, this field should be ignored.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>gid</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>116</c>
|
|
/// </remarks>
|
|
int GroupId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The size field is the size of the file in bytes;
|
|
/// linked files are archived with this field specified as zero.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>size</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>124</c>
|
|
/// </remarks>
|
|
long SizeInBytes { get; set; }
|
|
|
|
/// <summary>
|
|
/// <para>mtime</para>
|
|
/// <para>byte offset: 136</para>
|
|
/// The mtime field represents the data modification time of the file at the time it was archived.
|
|
/// It represents the integer number of seconds since January 1, 1970, 00:00 Coordinated Universal Time.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>mtime</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>136</c>
|
|
/// </remarks>
|
|
DateTime LastModification { get; set; }
|
|
|
|
/// <summary>
|
|
/// The typeflag field specifies the type of file archived.
|
|
/// If a particular implementation does not recognize or permit the specified type,
|
|
/// the file will be extracted as if it were a regular file.
|
|
/// As this action occurs, tar issues a warning to the standard error.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>typeflag</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>156</c>
|
|
/// </remarks>
|
|
EntryType EntryType { get; set; }
|
|
|
|
/// <summary>
|
|
/// The uname field will contain the ASCII representation of the owner of the file.
|
|
/// If found, the user ID is used rather than the value in the uid field.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>uname</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>265</c>
|
|
/// </remarks>
|
|
string UserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// The gname field will contain the ASCII representation of the group of the file.
|
|
/// If found, the group ID is used rather than the values in the gid field.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <c>gname</c>
|
|
/// <br/>
|
|
/// Byte offset: <c>297</c>
|
|
/// </remarks>
|
|
string GroupName { get; set; }
|
|
|
|
/// <summary>
|
|
/// The size of this header.
|
|
/// </summary>
|
|
int HeaderSize { get; }
|
|
}
|
|
}
|