Archiver
The Archiver
protocol abstracts away the different operations surrounding archives.
protocol Archiver : Sendable
Browse conforming typesThe Archiver
protocol abstracts away the different operations surrounding archives.
protocol Archiver : Sendable
import Basics
protocol Sendable
var supportedExtensions: Set<String> { get }
A set of extensions the current archiver supports.
func compress(directory: AbsolutePath, to destinationPath: AbsolutePath, completion: @escaping (Result<Void, Error>) -> Void)
Asynchronously compress the contents of a directory to a destination archive.
func extract(from archivePath: AbsolutePath, to destinationPath: AbsolutePath, completion: @escaping (Result<Void, Error>) -> Void)
Asynchronously extracts the contents of an archive to a destination folder.
func validate(path: AbsolutePath, completion: @escaping (Result<Bool, Error>) -> Void)
Asynchronously validates if a file is an archive.
func compress(directory: AbsolutePath, to destinationPath: AbsolutePath) async throws
Asynchronously compresses the contents of a directory to a destination archive.
func extract(from archivePath: AbsolutePath, to destinationPath: AbsolutePath) async throws
Asynchronously extracts the contents of an archive to a destination folder.
func isFileSupported(_ lastPathComponent: String) -> Bool
func validate(path: AbsolutePath) async throws -> Bool
Asynchronously validates if a file is an archive.