Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brentp/nim-gzfile
simple reader and writer for gzipped (and regular) files
https://github.com/brentp/nim-gzfile
gzip nim nim-lang zlib
Last synced: about 2 months ago
JSON representation
simple reader and writer for gzipped (and regular) files
- Host: GitHub
- URL: https://github.com/brentp/nim-gzfile
- Owner: brentp
- License: mit
- Created: 2019-10-02T22:01:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-22T02:26:00.000Z (over 4 years ago)
- Last Synced: 2024-10-13T02:21:13.626Z (3 months ago)
- Topics: gzip, nim, nim-lang, zlib
- Language: Nim
- Size: 5.86 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
this is a simple wrapper around your systems zlib.
it has an interface like nim's `File`.```Nim
var gz: GZFile
if not gz.open(f, bufsize=16384):
quit "couldn't open file"
echo gz.tell
var line:string
while gz.readLine(line):
echo lineecho gz.error
echo gz.tell
gz.close```
and writing:
```Nim
var wgz: GZFile
if not wgz.open(f, "w6"):
quit "couldn't open file"for i in 0..10:
wgz.write("hello ", "big ")
wgz.write_line("world")
wgz.close
```this works for both gzipped and regular files