Solved

How to get a files Last Modified date

Posted on 1998-06-09
2
185 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl to display a matrix report for 3-dimenional array 3 71
collecting information 2 184
Perl string replace for refred url 9 64
Using Perl DBI to query oracle 3 46
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…

830 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