Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: stat times

by Shendal (Hermit)
on Aug 12, 2002 at 18:04 UTC ( #189564=note: print w/ replies, xml ) Need Help??


in reply to stat times

How about something like this?

#/usr/bin/perl -w use strict; # always a good idea my $newfile = '/perl/bin/newr'; # consider File::Find, if you'd like to be recursive # also, always check the return value of opendir # (I suspect this may be the root of your problems) opendir(DIR,$newfile) or die "Unable to opendir!"; my @files = readdir(DIR); close(DIR); foreach (@files) { print "File: $_\n"; my($atime,$mtime) = (stat($_))[8,9]; print "atime: " . localtime($atime) . "\n"; print "mtime: " . localtime($mtime) . "\n"; }


Cheers,
Shendal


Comment on Re: stat times
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (15)
As of 2015-07-31 09:26 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 (276 votes), past polls