🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #384

Re: Time-stamping files

#384
From: Christian Weisgerber
Date: Sat, 14 Nov 2026 17:35
20 lines
1755 bytes
On 2026-11-14, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:

> What I lazily did was, say,   touch name*.pdf   but while the shell's
> file expansion lists sequentially name1.pdf name2.pdf ... name8.pdf
> the 'touch' command seems to _operate_ arguments in *reverse* order.

I think I've been surprised by cp(1) and/or mv(1) doing that, but
not enough to verify or investigate.  I expect such behavior could
come out of fts(3), which those utilities use.

BSD touch(1) operates in argument order.  For 4.4BSD it didn't
matter, because the time was fetched once and then applied to all
arguments.  Modern descendants now use utimensat(2) with UTIME_NOW.

This is a utility whose implementation at any point in time was
strongly influenced by the then available system calls.  BSD versions
from the 1980s used an actual read-write operation.  The horror.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de
Technical Details
Message-ID: <slrn11fh6vh.19u6.naddy@lorvorc.mips.inka.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news.in-chemnitz.de!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
References: <11d957u$1fnqs$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news.in-chemnitz.de!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: Christian Weisgerber <naddy@mips.inka.de>
Newsgroups: comp.unix.shell
Subject: Re: Time-stamping files
Date: Sat, 14 Nov 2026 17:35:45 -0000 (UTC)
Message-ID: <slrn11fh6vh.19u6.naddy@lorvorc.mips.inka.de>
References: <11d957u$1fnqs$1@dont-email.me>
Injection-Date: Sat, 14 Nov 2026 17:35:45 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
	logging-data="44365"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/pre1.0.4-9 (FreeBSD)