List Info

Thread: Newbie needs some help w/ files/dates ...




Newbie needs some help w/ files/dates ...
user name
2006-01-27 14:11:12
I'm new to this list.  

About 5 years ago I worked my way to the O'Reilly Perl for
Win32 book,
but haven't used it since. I have a need to write a Perl app
that will
check the timestamps of several known files in known
locations. If the
date/time of any of the files is not the current date, send
email to a
known list of recipients.

Can anyone get me started on how to check the date/time
stamp of a file
and compare it to the current day? I imagine this type of
simple task
is a no-brainer for almsot everyone on this list. Poking
back through
my book a bit now. All pointers to more info much
appeciated.  

Thanks very much in advance!

Chris
http://amateurec
onblog.blogspot.com/

Newbie needs some help w/ files/dates ...
user name
2006-01-27 14:28:03
stat() is your friend.  See perlfunc stat
Haven't used it on windoze, but it should work for your
needs.
Googling for 'perl stat win32' yielded among others:
http://www.unix.org.ua/orelly/perl/learn32/ch10_07.htm

time() ( see perlfunc time ) is what you want to use for
current time.


Both stat() and time() use the Epoch ( or  Unix ) time
stamp, which is
number of seconds since 01/01/1970.

Cheers, and good luck.
-p

Newbie needs some help w/ files/dates ...
user name
2006-01-27 15:39:26
Thanks!

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )