Try putting a copy of 1.log in your working directory as well as having
it in your faraway directory. For me, the 1.log will always appear first
on the sort.

--Paul

-----Original Message-----
From: Owen [mailto:[EMAIL PROTECTED] 
Posted At: Tuesday, December 30, 2003 10:35 PM
Posted To: Perl
Conversation: Problem with READDIR
Subject: Re: Problem with READDIR

On Tue, 30 Dec 2003 19:07:26 -0800
"Perl" <[EMAIL PROTECTED]> wrote:

> $iisdir = '\\\server01\c$\winnt\system32\logfiles\W3SVC1';
> opendir LOGS, "$iisdir" or die "Directory error for IIS LOGS:  $!\n";
> 
> my @files = grep /\.log$/, readdir LOGS;
> @files = sort { -M $a <=> -M $b } @files;
> $active_log = $files[-1];  # this should be the newest file rather
than
> a log in the local directory that the script is running from.



I was unable to duplicate your problem. Made 5 files 1.log .. 5.log
that order and in a faraway directory, and then 6.log in the working
directory. 

"5.log" came up every time


-- 
Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to