Solved

How to get a files Last Modified date

Posted on 1998-06-09
2
154 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
Comment Utility
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
Comment Utility
That's the info I was looking for!  

Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

763 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

10 Experts available now in Live!

Get 1:1 Help Now