| Date: Thu, 1 Aug 2002 17:35:51 +0100
| From: Lars Hecking <lhecking@nmrc.ie>
|
| > quickie for shell scripters:
| > How do I find out the time a file was created at?
|
|  There is no canonical test, and the information is not necessarily
|  available.  [ ... ]  This information is also shown by ls -lc, but
|  parsing ls' output requires a bit of effort. I'd rather recommend
|  [ writing ] a short C program to access the file status directly,
|  and output the ctime directly (seconds since the epoch, i.e. perfect
|  |  for numerical comparison).
some systems have a stat(1) tool --- don't think it's GNU --
which, when given the `-t' option, does exactly what Lars is
suggesting:
$ stat -t /etc/motd
/etc/motd 21 8 81a4 0 0 303 79 1 0 0 1028070983 830730492 1013296719
minor problem is the `-t' format is not actually explained in
the man page, but its fairly easy to work out (or you can just
look at the source).  also, since the filename is printed as
the first "field", bizarre filenames (e.g., ones which contain
spaces or newlines) can confuse a simple script.
cheers!
-blf-
|  (Another way is to use GNU find -printf with a custom format [ ... ]
--
Innovative, very experienced, Unix and      | Brian Foster    Dublin, Ireland
Chorus (embedded RTOS) kernel internals     | e-mail: blf@utvinternet.ie
expert looking for a new position ...       | mobile: (+353 or 0)86 854 9268
For a résumé, contact me, or see my website  http://www.blf.utvinternet.ie
Stop E$$o (ExxonMobile):  «Whatever you do, don't buy Esso --- they
don't give a damn about global warming.»    http://www.stopesso.com
Supported by Greenpeace, Friends of the Earth, and numerous others...
--
Irish Linux Users' Group: ilug@linux.ie
http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster@linux.ie

from localhost (localhost [127.0.0.1])
	by phobos.labs.netnoteinc.com (Postfix) with ESMTP id 5FC7B441E2
	for <jm@localhost>; Tue,  6 Aug 2002 06:48:17 -0400 (EDT)
from phobos [127.0.0.1]
	by localhost with IMAP (fetchmail-5.9.0)
	for jm@localhost (single-drop); Tue, 06 Aug 2002 11:48:17 +0100 (IST)
from lugh.tuatha.org (root@lugh.tuatha.org [194.125.145.45]) by
    dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g73EHtv15816 for
    <jm-ilug@jmason.org>; Sat, 3 Aug 2002 15:17:55 +0100
from lugh (root@localhost [127.0.0.1]) by lugh.tuatha.org
    (8.9.3/8.9.3) with ESMTP id PAA00866; Sat, 3 Aug 2002 15:16:05 +0100
from claymore.diva.ie (diva.ie [195.218.115.17] (may be forged))
    by lugh.tuatha.org (8.9.3/8.9.3) with ESMTP id PAA00813 for
    <ilug@linux.ie>; Sat, 3 Aug 2002 15:15:58 +0100
from cunniffe.net (ts08-118.dublin.indigo.ie [194.125.205.245])
    by claymore.diva.ie (8.9.3/8.9.3) with ESMTP id PAA05178 for
    <ilug@linux.ie>; Sat, 3 Aug 2002 15:15:55 +0100
From ilug-admin@linux.ie  Tue Aug  6 11:52:20 2002