Solved

How to get a files Last Modified date

Posted on 1998-06-09
2
166 Views
Last Modified: 2010-03-05
I am working on a script and everything is going nicely so far... but I can't find how to get a files Last Modified date. I am pretty sure it is a simple 'one line' statement, but I don't see it in my book.  

0
Comment
Question by:Voltec
2 Comments
 
LVL 6

Accepted Solution

by:
alamo earned 50 total points
ID: 1207775
The function you are looking for is stat.

 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks)
   = stat($filename);

(Can also take an open filehandle instead of a filename).

$mtime is the last modication time (which can be made printable etc. with localtime()).

Good luck!
0
 
LVL 3

Author Comment

by:Voltec
ID: 1207776
That's the info I was looking for!  

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how do I grep for a specfic DNS record in a directory 3 42
perl to mysql 5 130
git fat pull happens nothing in centos 6.3 python 2.6.6 33 207
Perl Frameworks 1 78
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now