Re: TEST_NT hack and OpenBSD

<[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <7069e966ae504ab6a93e524ff9c0346a@HE104834.emea1.cds.t-internal.com>
Hi,

>     newer(){ echo 'test -f $$m/'$1' -a $$m/'$1' -nt $@/'$2; }
>I've now replaced this use of an unportable shell primitive with a small auxiliary program.

Recently I saw a use of 'find' to compare dates of 2 files!

Alas, I have no idea how portable find's -maxdepth 0 option is
$ find foo -maxdepth 0 -newer bar -ls
So maybe an old-fashioned prune is the better option?
$ find foo -prune -newer bar -ls

Linux and OSX document maxdepth. However, the section on standards conformance in
a Linux manpage mentions -prune, not -maxdepth. This HP-UX manpage does not document -maxdepth
http://nixdoc.net/man-pages/HP-UX/find.1.html

Is there really a need to add 1000 lines of code to the repository and several new tests and gnulib modules *just for the utilities*, not even the actual program, just to compare dates?

Here's what looks like logic that should work across 40 years of UNIXisms

newer(){ [ -f "$1" ] && ([ ! -e "$2" ] || test -n "`find "$1" -prune -newer "$2"`"); }

Regards,
	Jörg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.