[Toybox] Fwd: potential addition of sponge to POSIX
Rob Landley
rob at landley.net
Tue Jun 24 16:03:23 PDT 2025
Anybody have a strong opinion on this command? It's 5 minutes to add,
probably something vaguely like:
USE_SPONGE(NEWTOY(sponge, ">1", TOYFLAG_USR|TOYFLAG_BIN))
void sponge_main(void)
{
off_t len = 0;
char *blah = readfd(0, 0, &len);
xwrite(*toys.optargs?xopen(*toys.optargs, O_CREATE|O_BINARY:1, 700),
blah, len);
}
https://linux.die.net/man/1/sponge
-------- Forwarded Message --------
Subject: potential addition of sponge to POSIX
Date: Thu, 19 Jun 2025 10:43:39 -0500
From: Eric Blake <eblake at redhat.com>
To: coreutils at gnu.org
The Austin Group has been asked whether future POSIX should include
the sponge(1) utility:
https://www.austingroupbugs.net/view.php?id=1927
Before the Austin Group decides whether to sponsor such an addition,
I'm trying to get feedback on whether standardizing the utility would
be worthwhile, or whether there are lurking caveats (such as
difficulties in implementing sponge to do atomic content changes
correctly) where we might be better off leaving it non-standard.
Right now, many GNU/Linux systems get sponge from moreutils; if POSIX
were to mandate sponge, would that be something we try to move into
coreutils rather than relying on moreutils? I also note that busybox
does not (yet) have a sponge applet, as far as I can tell, but would
likely add one if POSIX mandates the utility.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
More information about the Toybox
mailing list