[Toybox] [PATCH] test -ef -ot -nt (POSIX 2024)

Rob Landley rob at landley.net
Wed Jul 3 11:17:18 PDT 2024


On 7/3/24 00:37, Oliver Webb via Toybox wrote:
> Looking over the new stuff in POSIX 2024, toybox already has most of the stuff it specifies

I've been waiting for the html to go up on opengroup.org before considering it
"real", in part due to PDF being more awkward to deal with (eyestrain) and in
part due to a members-only spec behind a paywall with samizdat copies in the
wild not being something open source should bother with. Andrew Josey's 6/21
email https://www.mail-archive.com/austin-group-l@opengroup.org/msg12710.html
said it would take "up to a month" to publish the html.

That said, happy to get a jump on things if some subset of recent debian
features is now blessed by a third party...

> Excluding things like make which toybox doesn't have,

But should. I wonder if a posix-2024 make would actually build Linux From
Scratch packages?

> and gettext/msgfmt which from all
> the design documentation I've read Rob doesn't wanna add to toybox,

I consider them out of scope. When Aboriginal Linux built Linux From Scratch it
used https://landley.net/aboriginal/mirror/gettext-stub-1.tar.gz which NOPs out
the functions.

> These are the POSIX 2024 features toybox doesn't have:
> 
> dd iflag=fullblock

ok

> rm -d

Heh. Ok.

> tail -r (which from my checking coreutils doesn't have)

Which sadly means debian's man page doesn't either.

> test -ef -nt -ot
> 
> The attached patch adds in the test -ef -nt -ot
> 
> As for symbolic links:
> 
> $ test /bin/bash -ef /bin/sh && echo yes
> yes
> $ test /bin/bash -ot /bin/sh && echo yes
> yes
> 
> test is meant to follow symlinks _only_ when checking inodes with -ef

Applied locally, but you didn't update the help text. I can do that here if -nt
-ef and -ot have the same meanings as the 2019 debian "man 1 test" page...

Hmmm, -nt = newer than, -ot = older than, -ef is... how did "same" become e?
Equal? Equivalent? That sounds like contents, not "these are hardlinks to the
same dev/inode". Merriam Webster's thesaurus for "same" just gives those two E
words.

Expected, extracted, extruded, ectopic, electric, endemic, eloquent...

Bash "help test" says "True if file1 is a hardlink to file2". Can't argue...

Thanks,

Rob


More information about the Toybox mailing list