[EMAIL PROTECTED] 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);
}
</code>
the output of printf is: 19691231 for every file?
what am I doing wrong?
the date should be yesterdays date 20030915


[snip]
--


Maybe you need to stat the file in the dir..??


HTH

-- mike higgins




$dir = "\\\\$server\\c\$\\sys\\data\\LOG\\updates"; opendir (DIR, $dir) or die $!; . . . localtime((stat("$dir/$f"))[9]);



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

Reply via email to