Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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"; }


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://189564]
erix looks for a red-herring joke but can't find one
Discipulus has worked physically and he rediscovered he is no more wont..
erix instead casts a baleful eye on another mysql q.
[Corion]: erix: I'm not sure if it really is MySQL - maybe MS SQL also has LIMIT 0
[erix]: it has TOP, IIRC
[Corion]: erix: Ah. I use where 1 = 0 for queries where I only am interested in the structure ;)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-01-23 09:24 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (192 votes). Check out past polls.