-
Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to successfully read a particular container.
See moreDeclaration
Swift
public enum Format -
Processes TAR container and returns its “format”: a minimal set of extensions to basic TAR format required to successfully read this container.
Throws
TarError, which may indicate that either container is damaged or it might not be TAR container at all.See also
Declaration
Swift
public static func formatOf(container data: Data) throws -> FormatParameters
containerTAR container’s data.
-
Creates a new TAR container with
entriesas its content and generates itsData.See also
TarEntryInfoproperties documenation to see how their values are connected with the specific TAR format used during container creation.Declaration
Swift
public static func create(from entries: [TarEntry]) -> DataParameters
entriesTAR entries to store in the container.
-
Creates a new TAR container with
entriesas its content and generates itsDatausing the specifiedformat.This function forces the usage of the
format, meaning that certain properties of theentriesmay be missing from the resulting container data if the chosen format does not support corresponding features. For example, relatively long names (and linknames) will be truncated if the.ustaror.prePosixformat is specified.It is highly recommended to use the
TarContainer.create(from:)function (or use the.paxformat) to ensure the best representation of theentriesin the output. Other (non-PAX) formats should only be used if you have a specific need for them and you understand limitations of those formats.See also
TarEntryInfoproperties documenation to see how their values are connected with the specific TAR format used during container creation.Declaration
Parameters
entriesTAR entries to store in the container.
forceForce the usage of the specified format.
-
Processes TAR container and returns an array of
TarEntrywith information and data for all entries.Important
The order of entries is defined by TAR container and, particularly, by the creator of a given TAR container. It is likely that directories will be encountered earlier than files stored in those directories, but no particular order is guaranteed.
Throws
TarError, which may indicate that either container is damaged or it might not be TAR container at all.Declaration
Swift
public static func open(container data: Data) throws -> [TarEntry]Parameters
containerTAR container’s data.
Return Value
Array of
TarEntry. -
Processes TAR container and returns an array of
TarEntryInfowith information about entries in this container.Important
The order of entries is defined by TAR container and, particularly, by the creator of a given TAR container. It is likely that directories will be encountered earlier than files stored in those directories, but no particular order is guaranteed.
Throws
TarError, which may indicate that either container is damaged or it might not be TAR container at all.Declaration
Swift
public static func info(container data: Data) throws -> [TarEntryInfo]Parameters
containerTAR container’s data.
Return Value
Array of
TarEntryInfo.
View on GitHub
TarContainer Class Reference