Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PerfectlySoft/Perfect-Zip
Perfect Zip compression utility.
https://github.com/PerfectlySoft/Perfect-Zip
compression perfect server-side-swift swift zip
Last synced: 3 months ago
JSON representation
Perfect Zip compression utility.
- Host: GitHub
- URL: https://github.com/PerfectlySoft/Perfect-Zip
- Owner: PerfectlySoft
- License: apache-2.0
- Created: 2016-08-02T21:07:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T17:50:01.000Z (over 6 years ago)
- Last Synced: 2024-07-22T06:22:53.524Z (3 months ago)
- Topics: compression, perfect, server-side-swift, swift, zip
- Language: Swift
- Homepage: https://www.perfect.org
- Size: 118 KB
- Stars: 21
- Watchers: 7
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- TheList - Perfect-Zip - Perfect Zip compression utility. (Server Side Utilities / Compression)
- awesome-system-swift - Perfect-Zip
README
# Perfect Zip [简体中文](README.md)
Perfect Zip utility
This Perfect module wraps the minizip C library and provides simple zip and unzip functionality.
## Including in your project
Add this project as a dependency in your Package.swift file.
``` swift
.Package(url: "https://github.com/PerfectlySoft/Perfect-Zip.git", majorVersion: 3)
```## Running
The following will zip the specified directory:
``` swift
import PerfectZiplet zippy = Zip()
let thisZipFile = "/path/to/ZipFile.zip"
let sourceDir = "/path/to/files/"let ZipResult = zippy.zipFiles(
paths: [sourceDir],
zipFilePath: thisZipFile,
overwrite: true, password: ""
)
print("ZipResult Result: \(ZipResult.description)")```
To unzip a file:
``` swift
import PerfectZiplet zippy = Zip()
let sourceDir = "/path/to/files/"
let thisZipFile = "/path/to/ZipFile.zip"let UnZipResult = zippy.unzipFile(
source: thisZipFile,
destination: sourceDir,
overwrite: true
)
print("Unzip Result: \(UnZipResult.description)")```
## Further Information
For more information on the Perfect project, please visit [perfect.org](http://perfect.org).