On Tue, 16 Sep 2003, alex p wrote:

> Thank you all for replying, I am using the code below and I am still unable
> to get the correct date
> <code>
> opendir (DIR, "\\\\$server\\c\$\\sys\\data\\LOG\\updates");
>   @allfiles = readdir(DIR);
>   #print("," readdir(DIR));
>   #closedir(DIR);
>   foreach $f (@allfiles)
>       {
>         unless ( ($f eq ".") || ($f eq "..") )
>               {
>                 print "$f\n";
>                 (undef,undef,undef,$dom,$mon,$year)=localtime((stat($f))[9]);
>                 $mon++;
>                 $year += 1900;
>                 $dateval = printf("%04d%02d%02d\n",$year,$mon,$dom);
>                                }

That's probably because the files in @allfiles are not in your current
directory. Either prepend the directory to the front of each file
you stat or chdir to the directory.

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to