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, ifname
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’sentry.data.count
.Note
When a new TAR container is created, ifsize
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, ifaccessTime
is notnil
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, ifcreationTime
is notnil
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, ifmodificationTime
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?
-
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, ifownerID
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, ifgroupID
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, ifownerUserName
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, ifownerGroupName
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, ifdeviceMajorNumber
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, ifdeviceMinorNumber
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, ifcharset
is notnil
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, ifcomment
is notnil
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:
- 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, iflinkName
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, ifunknownExtendedHeaderRecords
is notnil
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.