https://github.com/mfelsche/ponyzip
https://github.com/mfelsche/ponyzip
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mfelsche/ponyzip
- Owner: mfelsche
- Created: 2021-05-04T18:37:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-07T20:56:32.000Z (almost 4 years ago)
- Last Synced: 2025-01-20T04:18:41.788Z (3 months ago)
- Language: Pony
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PonyZip
Reading .zip files with Pony.
Wrapper around [`libzip`](https://libzip.org).
## Usage
- Add `ponyzip` to your dependencies
```sh
corral add mfelsche/ponyzip --revision=v0.1.0
```- Install [`libzip`](https://libzip.org).
- Open a zipfile:```pony
use "ponyzip"
use "files"
use "format"actor Main
new create(env: Env) =>
try
let path_str = env.args(env.args.size() - 1)?
let path = FilePath(env.root as AmbientAuth, path_str)?
let archive = match Zip.open(path)
| let archive: ZipArchive => archive
| let e: ZipError =>
env.err.print(e.string())
error
end
for stat in archive.stats() do
env.out
.>write(stat.name as String)
.>write("\t")
.>write(
Format.int[U64]((stat.size as U64) where width=8))
.print(" bytes")
end
end
```
- Checkout more examples in [examples](examples).