[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] mac file modification date



At 23.32 10/25/97, Peter Furmonavicius wrote:
>Hello.  Is there a way to find out the modification date of a mac file
>from within MacPERL?
>
>- peter

Exactly the same as in any other version of Perl.

#!perl -wl
$lastmod = time - ((-M 'PowerPudgeII:Desktop Folder:leak.pl')*86400);
print scalar localtime($lastmod);

-M returns the modification age in days of the file (days since it was last modified).  Multiply by 86400 to get the age in seconds.  Subtract from time to get the actual time it was modified.   Then you can do what you want with it (such as run it through scalar localtime() to get a text representation of it).

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch