Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Comparing modification times like make

by Krambambuli (Deacon)
on Oct 27, 2008 at 12:57 UTC ( #719731=note: print w/ replies, xml ) Need Help??


in reply to Comparing modification times like make

The Perl Cookbook recommends

-------------
Recipe 9.1. Getting and Setting Timestamps

9.1.1. Problem

You need to retrieve or alter when a file was last modified (written or changed) or accessed (read).

9.1.2. Solution

Use stat to get those times and utime to set them. Both functions are built into Perl:

($READTIME, $WRITETIME) = (stat($filename))[8,9];

utime($NEWREADTIME, $NEWWRITETIME, $filename);

9.1.3. Discussion
[...]
-----------

But I do not know how well this does on Windows.

Updated formatting error, to show the code correctly - thanks Perlbotics


Krambambuli
---


Comment on Re: Comparing modification times like make
Re^2: Comparing modification times like make
by cdarke (Prior) on Oct 27, 2008 at 13:40 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://719731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-06 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls