Skip to content

LIFX/ZipArchive.swift

Repository files navigation

ZipArchive.swift

Build Status codecov

Zip archiving library written in Swift and C.

This library inspired by System.IO.Compression namespace of the .NET Framework.

Usage

Unzip

import ZipArchive

let sourceFile = "/path/to/archive.zip"
let destinationDirectory = "/path/to/directory"
try! ZipFile.extractToDirectory(sourceFile, destinationDirectoryName: destinationDirectory)

Zip

import ZipArchive

let sourceDirectory = "/path/to/directory"
let destinationFile = "/path/to/archive.zip"
try! ZipFile.createFromDirectory(sourceDirectory, destinationArchiveFileName: destinationFile)

Enumerate files in zip file

import ZipArchive

let archiveFile = "/path/to/archive.zip"
let archive = ZipArchive(path: archiveFile, mode: .Read)!
defer { archive.dispose() }

for entry in archive.entries {
    print("\(entry.fullName)")
}

Installation

CocoaPods

TBD

Carthage

github "yaslab/ZipArchive.swift" ~> 0.2.0

Swift Package Manager

.package(url: "https://github.com/yaslab/ZipArchive.swift.git", .upToNextMinor(from: "0.2.0"))

License

ZipArchive.swift is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages