lisaw has asked for the wisdom of the Perl Monks concerning the following question:
Thank you for any help that you can provide. lisforeach $line (sort @files) { $temp_file = "$query/$line"; ($filesize, $filedate, $perm) = (stat($temp_file))[7, 9, 2]; $perm = sprintf "%lo", ($perm & 07777); &getdate; ($a, $b) = split(/\./, $line); if ($b ne "") { print <<"__END_OF_HTML_CODE__"; $filetime $filedate __END_OF_HTML_CODE__ }} sub getdate { ($min, $hr, $day, $mon, $yr) = (localtime($filedate))[1,2,3,4,5]; if ($min < 10) { $min = "0$min"; } if ($hr < 10) { $hr = "0$hr"; } if ($day < 10) { $day = "0$day"; } if ($mon < 10) { $mon = "0$mon"; } $yr = $yr+1900; $filedate = "$mon-$day-$yr"; $filetime = "$hr:$min:00"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Timestamp Question
by Roger (Parson) on Oct 14, 2003 at 00:25 UTC | |
by ysth (Canon) on Oct 14, 2003 at 09:52 UTC | |
by lisaw (Beadle) on Oct 14, 2003 at 00:34 UTC | |
by Roger (Parson) on Oct 14, 2003 at 00:58 UTC | |
|
Re: File Timestamp Question
by bradcathey (Prior) on Oct 14, 2003 at 01:13 UTC |