[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] [PATCH] mdate.sh: rewrite in Perl
From: |
Colin Watson |
Subject: |
Re: [Groff] [PATCH] mdate.sh: rewrite in Perl |
Date: |
Sat, 18 Feb 2017 21:49:46 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, Feb 18, 2017 at 01:07:38PM -0500, James K. Lowden wrote:
> On Sat, 18 Feb 2017 03:28:03 +0000
> Colin Watson <address@hidden> wrote:
> > This version is much shorter and easier to understand than the
> > shell/awk version: we don't have to worry about convincing ls to
> > produce output that we can parse, and we don't have to play games
> > with the way that the same field may contain either the year or the
> > time depending on how old the file is.
>
> Attached please find fdate.c. It accepts filename argments and prints
> the files' mtimes (and, optionally, names). Like date(1), it accepts a
> strftime format argument, defaulting to yyyy-mm-dd.
Thanks. This is for a small build helper used to embed modification
times in manual pages, though; I'm not sure it's worth trying too hard.
It has precisely one purpose and does not require additional optional
behaviours.
My usual philosophy for such things is that small and
quick-to-understand code is better than more performant code;
furthermore, having to compile a helper first would require adding more
complication to the build system.
--
Colin Watson address@hidden