----- Original Message ----- From: "alex p" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 16, 2003 11:42 Subject: Re: newbie hlelp!
> 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 > Alex, I found that the method that worked best for me in a similar circumstance was to parse the output of the DOS dir command. Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters USA Central Time Zone 636-922-9158 ext. 8652 fax 636-447-4471 [EMAIL PROTECTED] www.nisc.cc _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs