TarEntry

public class TarEntry: ContainerEntry

Represents either a file or directory entry in TAR container.

  • Represents a type of an entry.

    Warning

    Deprecated and will be removed in 4.0. FileAttributeType values will be used instead.
    See more

    Declaration

    Swift

    public enum EntryType: String
  • Name of the file or directory.

    Declaration

    Swift

    public var name: String
  • True, if an entry is a directory.

    Declaration

    Swift

    public var isDirectory: Bool
  • Size of the data associated with the entry.

    Declaration

    Swift

    public private(set) var size: Int
  • Provides a dictionary with various attributes of the entry. FileAttributeKey values are used as dictionary keys.

    Note

    Will be renamed in 4.0.

    Possible attributes:

    • FileAttributeKey.posixPermissions,
    • FileAttributeKey.ownerAccountID,
    • FileAttributeKey.groupOwnerAccountID,
    • FileAttributeKey.size,
    • FileAttributeKey.modificationDate,
    • FileAttributeKey.type,
    • FileAttributeKey.ownerAccountName, if format of container is UStar,
    • FileAttributeKey.groupOwnerAccountName, if format of container is UStar,
    • FileAttributeKey.creationDate, if format of container is PAX.

    Most modern TAR containers are in UStar format.

    Declaration

    Swift

    public let entryAttributes: [FileAttributeKey: Any]
  • File mode.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public let mode: Int?
  • Owner’s ID.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public private(set) var ownerID: Int?
  • Owner’s group ID.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public private(set) var groupID: Int?
  • The most recent modification time of the original file or directory.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public private(set) var modificationTime: Date
  • Type of entry.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public let type: EntryType
  • Owner’s user name.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public private(set) var ownerUserName: String?
  • Owner’s group name.

    Warning

    Deprecated and will be removed in 4.0. Use entryAttributes instead.

    Declaration

    Swift

    public private(set) var ownerGroupName: String?
  • The most recent access time of the original file or directory (PAX only).

    Declaration

    Swift

    public private(set) var accessTime: Date?
  • The creation time of the original file or directory (PAX only).

    Declaration

    Swift

    public private(set) var creationTime: Date?
  • Name of the character set used to encode entry’s data (PAX only).

    Declaration

    Swift

    public private(set) var charset: String?
  • Comment associated with the entry (PAX only).

    Declaration

    Swift

    public private(set) var comment: String?
  • Path to a linked file.

    Declaration

    Swift

    public var linkPath: String?
  • Other entries from PAX extended headers.

    Declaration

    Swift

    public private(set) var unknownExtendedHeaderEntries: [String: String] = [:]
  • Returns data associated with this entry.

    Declaration

    Swift

    public func data() -> Data