Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

file modify/access date and time

0 views
Skip to first unread message

Marin Lazar

unread,
Dec 15, 1997, 3:00:00 AM12/15/97
to

Anyone out there have a C program or other usefull way to display the
modifying/accessing time an date for a UNIX file.

Thanks in advance.
M.L.

mla...@globalserve.net
mla...@mobility.com


sublett

unread,
Dec 16, 1997, 3:00:00 AM12/16/97
to

"Marin Lazar" <mla...@globalserve.net> writes:

> Anyone out there have a C program or other usefull way to display the
> modifying/accessing time an date for a UNIX file.
>

man ls perhaps?

time of modification ls -l
time of last access ls -lu

$ ls -l
total 2
drwx------ 2 sublett folks 512 Dec 14 10:58 mail
drwx------ 2 sublett folks 512 Dec 15 17:36 private
$ ls -lu
total 2
drwx------ 2 sublett folks 512 Dec 15 17:36 mail
drwx------ 2 sublett folks 512 Dec 15 17:36 private

I'm sure sed can be used to strip the output of ls to just the time and
date.

--
sublett <sub...@earthling.net.no^spam>
:-----------------------------------------------------------------------:
Sublett's Nest :---------------------: http://www.cryogen.com/sublett
:-----------------------------------------------------------------------:

John Kevan

unread,
Dec 17, 1997, 3:00:00 AM12/17/97
to

Marin Lazar <mla...@globalserve.net> wrote in article
<674r62$eiq$1...@titan.globalserve.net>...

> Anyone out there have a C program or other usefull way to display the
> modifying/accessing time an date for a UNIX file.
>
> Thanks in advance.
> M.L.
>
> mla...@globalserve.net
> mla...@mobility.com
>

You can use the 'touch' command to modify these entries. To view them you
can write a tiny perl script ( if you have perl installed ) and use the
'stat' file operator. This will give you access/modification/creation times
and a whole lot more...


John Kevan
17/12/1997

Randal Schwartz

unread,
Dec 26, 1997, 3:00:00 AM12/26/97
to John Kevan

>>>>> "John" == John Kevan <john....@health.wa.gov.au> writes:

John> You can use the 'touch' command to modify these entries. To view
John> them you can write a tiny perl script ( if you have perl
John> installed ) and use the 'stat' file operator. This will give you
John> access/modification/creation times and a whole lot more...

Nope. Not "creation" time. No such thing.

ctime = last inode change time.

--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <mer...@stonehenge.com> Snail: (Call) PGP-Key: (finger mer...@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me

0 new messages