TarEntryInfo
public struct TarEntryInfo : ContainerEntryInfo
Provides access to information about an entry from the TAR container.
-
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:
- Local PAX extended header “path” property.
- Global PAX extended header “path” property.
- GNU format type “L” (LongName) entry.
- Default TAR header.
Note
When a new TAR container is created, ifnamecannot 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,nameis 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’sentry.data.count.Note
When a new TAR container is created, ifsizeis 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;
nilotherwise).Note
When a new TAR container is created, ifaccessTimeis notnilthen 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;
nilotherwise).Note
When a new TAR container is created, ifcreationTimeis notnilthen 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, ifmodificationTimeis 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?
-
Entry’s compression method. Always
.copyfor the entries of TAR containers.Declaration
Swift
public let compressionMethod: CompressionMethod -
ID of entry’s owner.
Note
When a new TAR container is created, ifownerIDis 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, ifgroupIDis 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, ifownerUserNamecannot 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,ownerUserNameis 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, ifownerGroupNamecannot 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,ownerGroupNameis 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, ifdeviceMajorNumberis 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, ifdeviceMinorNumberis 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;
nilotherwise).Note
When new TAR container is created, ifcharsetis notnilthen 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;
nilotherwise).Note
When new TAR container is created, ifcommentis notnilthen 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:
- Local PAX extended header “linkpath” property.
- Global PAX extended header “linkpath” property.
- GNU format type “K” (LongLink) entry.
- Default TAR header.
Note
When new TAR container is created, iflinkNamecannot 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,linkNameis 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, ifunknownExtendedHeaderRecordsis notnilthen 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
nameEntry’s name.
typeEntry’s type.
View on GitHub
TarEntryInfo Structure Reference