From: "Ludovic Courtès" <ludo@gnu.org>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: Tobias Geerinckx-Rice <me@tobias.gr>,
Simon Tournier <zimon.toutoune@gmail.com>,
paren@disroot.org, Christopher Baines <mail@cbaines.net>,
63766@debbugs.gnu.org, Ricardo Wurmus <rekado@elephly.net>,
Raghav Gururajan <rg@raghavgururajan.name>,
jgart <jgart@dismail.de>, Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#63766] [PATCH 0/4] Image for HiFive Unmatched
Date: Thu, 22 Jun 2023 00:08:16 +0200 [thread overview]
Message-ID: <878rcc5uzz.fsf@gnu.org> (raw)
In-Reply-To: <ZIg8q3XKUriocOkv@3900XT> (Efraim Flashner's message of "Tue, 13 Jun 2023 12:53:47 +0300")
Hi,
Efraim Flashner <efraim@flashner.co.il> skribis:
> I changed it to:
>
> (let ((size (partition-size partition)))
> ;; Create the file and then truncate it to the desired size.
> (with-output-to-file target
> (lambda _ (display "")))
> (truncate-file target size)))
>
> And that got me the empty partition/block device as needed.
A slight improvement would be:
(catch 'system-error
(lambda ()
(truncate-file target size))
(lambda args
(if (= ENOENT (system-error-errno args))
(call-with-output-file target (const #t))
(apply throw args))))
It’s more verbose but makes the intent clearer.
Ludo’.
next prev parent reply other threads:[~2023-06-21 22:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 9:41 [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Efraim Flashner
2023-05-28 9:44 ` [bug#63766] [PATCH 1/4] gnu: bootloader: Add u-boot-sifive-unmatched-bootloader Efraim Flashner
2023-05-28 9:44 ` [bug#63766] [PATCH 2/4] gnu: image: Add support for unformatted partitions Efraim Flashner
2023-06-09 20:42 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-06-13 9:53 ` Efraim Flashner
2023-06-21 22:08 ` Ludovic Courtès [this message]
2023-05-28 9:44 ` [bug#63766] [PATCH 3/4] system: images: Add unmatched module Efraim Flashner
2023-06-09 20:46 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-05-28 9:44 ` [bug#63766] [PATCH 4/4] gnu: glibc-2.33: Fix building for riscv64-linux Efraim Flashner
2023-06-09 20:49 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-06-09 20:50 ` Ludovic Courtès
2023-06-14 11:59 ` bug#63766: " Efraim Flashner
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878rcc5uzz.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=63766@debbugs.gnu.org \
--cc=efraim@flashner.co.il \
--cc=jgart@dismail.de \
--cc=mail@cbaines.net \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=paren@disroot.org \
--cc=rekado@elephly.net \
--cc=rg@raghavgururajan.name \
--cc=zimon.toutoune@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.