Recursively scanning a directory on Mac OS X for size Timestap

2003-09-18 Thread Shishir Saxena
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
titlePath of File/title
/head

body

table border=1 width=106%
  tr
td width=20% align=center bgcolor=#00bPath of
File/b/td
td width=20% align=center bgcolor=#00bFile
Version/b/td
td width=20% align=center bgcolor=#00bBuild
Number/b/td
td width=20% align=center bgcolor=#00bSize on
Disk/b/td
td width=20% align=center bgcolor=#00bTimestamp/b/td
  /tr';

find (\wanted,$Root);
  
print OUT '  /table
pnbsp;/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=#CC'.$file.'/td
td width=20% align=center bgcolor=#CCNot Available/td
td width=20% align=center bgcolor=#CCNot Available/td
td width=20% align=center bgcolor=#CC'.$size.'/td
td width=20% align=center bgcolor=#CC'.$time.'/td
/tr';

Regards,
Shishir Saxena




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



recursively finding file size/timestamp on a Mac / Solaris

2003-09-18 Thread Shishir Saxena
Hi,

This is wat I'm doing... but its not working :-(

find (\wanted,$Root);
  
print OUT '  /table
pnbsp;/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;
   

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



.exe is mandatory :-(

2003-09-08 Thread Shishir Saxena
I just installed perl and I don't know what settings I fiddled with, but now
on Windows Command Prompt I am unable to execute perl scripts with
somthing like, perl test.pl rather I have to do perl.exe test.pl
same for any application ... everything has to be suffixed with a .EXE
...
Please advise ...

Regards,
Shishir Saxena




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



Equivalent of GetVersionInfo ()

2003-09-05 Thread Shishir Saxena
Hi,

Is there a way to get the information returned by the VC++ fn
GetVersionInfo( ); thru any of the perl structures / commands ?
PS : If this is too easy a question...plz pardon my ignorance but I'm really
new to perl !

Regards,
Shishir Saxena




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



RE: Equivalent of GetVersionInfo ()

2003-09-05 Thread Shishir Saxena
Hi,

It reads the resource of the file on which the function is used on and it
returns a 
collective string that has everything that is part of the resource like,
copyright info,
build number (if a components or executable), date of creation etc. I intend
to
then creat a log of that information.



-Original Message-
From: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 12:58 PM
To: 'Shishir Saxena'; [EMAIL PROTECTED]
Subject: RE: Equivalent of GetVersionInfo ()


Shishir Saxena [EMAIL PROTECTED] wrote:

: Is there a way to get the information returned by the VC++ fn
: GetVersionInfo(); thru any of the perl structures / commands?

What does GetVersionInfo() return?


Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328

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



RE: perl questions / exercices

2003-09-05 Thread Shishir Saxena
Well since you've asked for it how about doing this,

I want to make a cross-platform utility that when provided with the location
of a directory structure generates the following log,

1) Date of creation
2) Size on Disk
3) Build number of the component / executable.
4) Copyright info (if included in the resource file)


So what do you think ?

-Original Message-
From: Ged [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 3:59 PM
To: [EMAIL PROTECTED]
Subject: perl questions / exercices


Hi all,

I am currently learning perl reading all the material I can get my hands on,
but have no use for it on a daily basis.

Because of this I am not getting the practice I need on a day-to-day basis
to gain more knowledge.

Having covered all the questions in books like 'Learning Perl' etc I need
more exercises, if not small projects to further my skills.

Its not easy to think up usefull projects, so my question is, does anybody
know of anything on the net to challenge me 

Thanks,

Ged.

(p.s. I am still in the early stages so long complicated projects are still
a little out of my reach at the moment.)

-
Email provided by http://www.ntlhome.com/



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

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