TarEntryInfo

public struct TarEntryInfo : ContainerEntryInfo

Provides access to information about an entry from the TAR container.

ContainerEntryInfo

  • Entry’s name.

    Depending on the particular format of the container, different container’s structures are used to set this property, in the following preference order:

    1. Local PAX extended header “path” property.
    2. Global PAX extended header “path” property.
    3. GNU format type “L” (LongName) entry.
    4. Default TAR header.

    Note

    When a new TAR container is created, if name cannot be encoded with ASCII or its ASCII byte-representation is longer than 100 bytes then a PAX extended header will be created to represent this value correctly, unless other format is forced.

    Note

    When creating new TAR container, name is always encoded with UTF-8 in the basic TAR header.

    Declaration

    Swift

    public var name: String
  • Entry’s data size.

    Note

    This property cannot be directly modified. Instead it is updated automatically to be equal to its parent’s entry.data.count.

    Note

    When a new TAR container is created, if size is bigger than 8589934591 then a PAX extended header will be created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be used to encode this value in the basic TAR header.

    Declaration

    Swift

    public internal(set) var size: Int? { get }
  • Declaration

    Swift

    public let type: ContainerEntryType
  • Entry’s last access time (only available for PAX format; nil otherwise).

    Note

    When a new TAR container is created, if accessTime is not nil then a PAX extended header will be created to store this property, unless other format is forced.

    Declaration

    Swift

    public var accessTime: Date?
  • Entry’s creation time (only available for PAX format; nil otherwise).

    Note

    When a new TAR container is created, if creationTime is not nil then a PAX extended header will be created to store this property, unless other format is forced.

    Declaration

    Swift

    public var creationTime: Date?
  • Entry’s last modification time.

    Note

    When a new TAR container is created, if modificationTime is bigger than 8589934591 then a PAX extended header will be created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be used to encode this value in the basic TAR header.

    Declaration

    Swift

    public var modificationTime: Date?
  • Declaration

    Swift

    public var permissions: Permissions?

TAR specific

  • Entry’s compression method. Always .copy for the entries of TAR containers.

    Declaration

    Swift

    public let compressionMethod: CompressionMethod
  • ID of entry’s owner.

    Note

    When a new TAR container is created, if ownerID is bigger than 2097151 then a PAX extended header will be created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be used to encode this value in the basic TAR header.

    Declaration

    Swift

    public var ownerID: Int?
  • ID of the group of entry’s owner.

    Note

    When a new TAR container is created, if groupID is bigger than 2097151 then a PAX extended header will be created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be used to encode this value in the basic TAR header.

    Declaration

    Swift

    public var groupID: Int?
  • User name of entry’s owner.

    Note

    When a new TAR container is created, if ownerUserName cannot be encoded with ASCII or its ASCII byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value correctly, unless other format is forced.

    Note

    When creating new TAR container, ownerUserName is always encoded with UTF-8 in the ustar header.

    Declaration

    Swift

    public var ownerUserName: String?
  • Name of the group of entry’s owner.

    Note

    When new TAR container is created, if ownerGroupName cannot be encoded with ASCII or its ASCII byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value correctly, unless other format is forced.

    Note

    When creating new TAR container, ownerGroupName is always encoded with UTF-8 in the ustar header.

    Declaration

    Swift

    public var ownerGroupName: String?
  • Device major number (used when entry is either block or character special file).

    Note

    When new TAR container is created, if deviceMajorNumber is bigger than 2097151 then base-256 encoding will be used to encode this value in ustar header.

    Declaration

    Swift

    public var deviceMajorNumber: Int?
  • Device minor number (used when entry is either block or character special file).

    Note

    When new TAR container is created, if deviceMinorNumber is bigger than 2097151 then base-256 encoding will be used to encode this value in ustar header.

    Declaration

    Swift

    public var deviceMinorNumber: Int?
  • Name of the character set used to encode entry’s data (only available for PAX format; nil otherwise).

    Note

    When new TAR container is created, if charset is not nil then a PAX extended header will be created to store this property, unless other format is forced.

    Declaration

    Swift

    public var charset: String?
  • Entry’s comment (only available for PAX format; nil otherwise).

    Note

    When new TAR container is created, if comment is not nil then a PAX extended header will be created to store this property, unless other format is forced.

    Declaration

    Swift

    public var comment: String?
  • Path to a linked file for symbolic link entry.

    Depending on the particular format of the container, different container’s structures are used to set this property, in the following preference order:

    1. Local PAX extended header “linkpath” property.
    2. Global PAX extended header “linkpath” property.
    3. GNU format type “K” (LongLink) entry.
    4. Default TAR header.

    Note

    When new TAR container is created, if linkName cannot be encoded with ASCII or its ASCII byte-representation is longer than 100 bytes then a PAX extended header will be created to represent this value correctly, unless other format is forced.

    Note

    When creating new TAR container, linkName is always encoded with UTF-8 in basic TAR header.

    Declaration

    Swift

    public var linkName: String
  • All custom (unknown) records from global and local PAX extended headers. nil, if there were no headers.

    Note

    When new TAR container is created, if unknownExtendedHeaderRecords is not nil then a local PAX extended header will be created to store this property, unless other format is forced.

    Declaration

    Swift

    public var unknownExtendedHeaderRecords: [String : String]?
  • Initializes the entry’s info with its name and type.

    Note

    Entry’s type cannot be modified after initialization.

    Declaration

    Swift

    public init(name: String, type: ContainerEntryType)

    Parameters

    name

    Entry’s name.

    type

    Entry’s type.