Solved

How to get a files Last Modified date

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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