in reply to Re: Most recently created file in a folder
in thread Most recently created file in a folder
Any way I can use a remote folder please?use constant ATIME => 9; use constant MTIME => 10; use constant CTIME => 11; my $dir = "\\\\Sn007a_srv\\c\$\\program files\\common files\\sysadmin\ +\log\\ApplicationSynchronizer"; my $time = CTIME; my @files = map{ scalar localtime($_->[$time]). "\t" . $_->[0]} sort{ $b->[$time] <=> $a->[$time] } map{ [ $_, stat($_) ] } grep { -f } glob ( "$dir\\*" ); print "$files[0]\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Most recently created file in a folder
by bluto (Curate) on Sep 07, 2004 at 15:12 UTC |