From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org, guile-user@gnu.org, guile-sources@gnu.org
Subject: Re: Guile-zstd 0.1.1 released
Date: Mon, 28 Dec 2020 07:48:29 +0100 [thread overview]
Message-ID: <8735zqfmte.fsf@web.de> (raw)
In-Reply-To: <87k0t3thsw.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]
Hi Ludo,
that’s pretty cool! Thank you!
Looking at the readme I get the feeling that two little helpers could be
useful:
(call-with-zstd-output-file "compressed.zstd"
(lambda (port)
(define data
;; Read the input file in memory.
(call-with-input-file "input-file.txt"
get-bytevector-all))
;; Write data to PORT.
(put-bytevector port data)))
(call-with-zstd-input-file "compressed.zst"
(lambda (port)
;; Read decompressed data from PORT.
...))
Potentially with streaming added (if that’s possible from the library):
(call-with-zstd-output-file "compressed.zstd"
(lambda (outport)
(call-with-input-file "input-file.txt"
(lambda (inport)
(let loop ((data (get-bytevector-some inport)))
(when (not (eof-object? data))
(put-bytevector outport data)
(loop (get-bytevector-some inport))))))))
Also maybe a minimal representation of the commandline-interface:
(zstd-compress "input-file.txt" #:output "compressed.zst")
(zstd-decompress "compressed.zstd" #:output "cleartext-file.zst")
Best wishes,
Arne
Ludovic Courtès <ludo@gnu.org> writes:
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> I’m pleased to announce the first release of Guile-zstd:
>
> Oops, a file was missing from the repo, so here’s a brand new release!
>
> git clone https://notabug.org/guile-zstd/guile-zstd
> cd guile-zstd
> git checkout v0.1.1 # or f853c8eb81088f8fbf33d38e62cddea9a4984180
> git tag -v v0.1.1
>
> Ludo’.
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
next prev parent reply other threads:[~2020-12-28 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-27 14:01 Guile-zstd 0.1.0 released Ludovic Courtès
2020-12-27 15:00 ` Guile-zstd 0.1.1 released Ludovic Courtès
2020-12-28 6:48 ` Dr. Arne Babenhauserheide [this message]
2021-01-04 19:19 ` Aleix Conchillo Flaqué
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735zqfmte.fsf@web.de \
--to=arne_bab@web.de \
--cc=guile-sources@gnu.org \
--cc=guile-user@gnu.org \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).