Hi, 

I'm doing the following and the purpose is to genrate a HTML log file. But
the script says "Can not apply stat : No such file or directory found"
Can someone plz tell me where I'm going wrong ?

use File::Find;
use File::stat;


open (OUT,">./out.html");

$Root = $ARGV[0];
print $Root;

my $var;

print OUT '<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Path of File</title>
</head>

<body>

<table border="1" width="106%">
  <tr>
    <td width="20%" align="center" bgcolor="#CCCC00"><b>Path of
File</b></td>
    <td width="20%" align="center" bgcolor="#CCCC00"><b>File
Version</b></td>
    <td width="20%" align="center" bgcolor="#CCCC00"><b>Build
Number</b></td>
    <td width="20%" align="center" bgcolor="#CCCC00"><b>Size on
Disk</b></td>
    <td width="20%" align="center" bgcolor="#CCCC00"><b>Timestamp</b></td>
  </tr>';

    find (\&wanted,"$Root");
  
print OUT '  </table>
<p>&nbsp;</p>

</body>

</html>';

sub wanted()
{
   if (-d $File::Find::name)
   {
    return;
    }
   $file = $File::Find::name;
   $file =~ s/\//\\/g;
   $st = stat($file);
   $size = $st->size;
   $size = ($size/1024)."KB ($size bytes)";
   $time = scalar localtime $st->mtime;
   
                   
                    
                    print OUT '
                      <tr>
    <td width="20%" align="center" bgcolor="#FFFFCC">'."$file".'</td>
    <td width="20%" align="center" bgcolor="#FFFFCC">Not Available</td>
    <td width="20%" align="center" bgcolor="#FFFFCC">Not Available</td>
    <td width="20%" align="center" bgcolor="#FFFFCC">'."$size".'</td>
    <td width="20%" align="center" bgcolor="#FFFFCC">'."$time".'</td>
    </tr>';

Regards,
Shishir Saxena
____________________________________________



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to