Re: Using Perl to Read jar file MANIFEST file.

2008-03-07 Thread Michael Barto




THANK for the tip. This will work fine. Great mailing list

Claes Jakobsson wrote:
#!/usr/bin/perl
  
  
use strict;
  
use warnings;
  
  
use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
  
use Archive::Zip::MemberRead;
  
  
my $archive = Archive::Zip->new();
  
die "read error" if $archive->read(shift) != AZ_OK;
  
  
my $fh  = Archive::Zip::MemberRead->new($archive,
"META-INF/MANIFEST.MF");
  
while (defined($_ = $fh->getline())) {
  
    print "$_\n";
  
}
  
  
  
  
galaxy:~ claes$ perl jar_reader.pl /usr/share/java/junit.jar
  
Manifest-Version: 1.0
  
Ant-Version: Apache Ant 1.6.5
  
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
  
  
  
seems to work
  
  
/Claes
  
  
On 5 mar 2008, at 19.40, Claes Jakobsson wrote:
  
  On 5 mar 2008, at 19.23, Michael Barto wrote:

Has anybody every tried to create a Perl
program ro read the contents of the MANIFEST file in java jar file? We
are trying to develop something to provide comparisons for change
between different implementations. Is this a simple Perl backtic,
system or exec of the jar command or is there a more exotic way to do
it? Also, we need to extract Checksum. But that seems documented.
  


If I remember correctly JAR files are simply Zip files so you should be
able to use something like Archive::Zip to read the file.


Cheers

Claes

  
  


-- 





  

  
  


  Michael Barto
  Software Architect
  
  
  
  


   LogiQwest
Inc.
16458 Bolsa Chica Street, # 15
Huntington Beach, CA  92649
  http://www.logiqwest.com/
  
  
     
  [EMAIL PROTECTED]
Tel:  714 377 3705
Fax: 714 840 3937
Cell: 714 883 1949
  
  


  'tis a gift to be
simple
   


   This e-mail may contain
LogiQwest
proprietary information and should be treated as confidential. 

  








Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Charlie Garrison

Good afternoon,

On 5/3/08 at 10:23 AM -0800, Michael Barto 
<[EMAIL PROTECTED]> wrote:


Has anybody every tried to create a Perl program ro read the 
contents of the MANIFEST file in java jar file? We are trying 
to develop something to provide comparisons for change between 
different implementations. Is this a simple Perl backtic, 
system or exec of the jar command or is there a more exotic way 
to do it? Also, we need to extract Checksum. But that seems documented.


Did you ask CPAN? There seems to be a few modules which might be 
helpful for you:





Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt


Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Claes Jakobsson

#!/usr/bin/perl

use strict;
use warnings;

use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
use Archive::Zip::MemberRead;

my $archive = Archive::Zip->new();
die "read error" if $archive->read(shift) != AZ_OK;

my $fh  = Archive::Zip::MemberRead->new($archive, "META-INF/ 
MANIFEST.MF");

while (defined($_ = $fh->getline())) {
print "$_\n";
}



galaxy:~ claes$ perl jar_reader.pl /usr/share/java/junit.jar
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)


seems to work

/Claes

On 5 mar 2008, at 19.40, Claes Jakobsson wrote:

On 5 mar 2008, at 19.23, Michael Barto wrote:
Has anybody every tried to create a Perl program ro read the  
contents of the MANIFEST file in java jar file? We are trying to  
develop something to provide comparisons for change between  
different implementations. Is this a simple Perl backtic, system or  
exec of the jar command or is there a more exotic way to do it?  
Also, we need to extract Checksum. But that seems documented.


If I remember correctly JAR files are simply Zip files so you should  
be able to use something like Archive::Zip to read the file.


Cheers
Claes


Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Claes Jakobsson

On 5 mar 2008, at 19.23, Michael Barto wrote:
Has anybody every tried to create a Perl program ro read the  
contents of the MANIFEST file in java jar file? We are trying to  
develop something to provide comparisons for change between  
different implementations. Is this a simple Perl backtic, system or  
exec of the jar command or is there a more exotic way to do it?  
Also, we need to extract Checksum. But that seems documented.


If I remember correctly JAR files are simply Zip files so you should  
be able to use something like Archive::Zip to read the file.


Cheers
Claes


Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Michael Barto




Has anybody every tried to create a Perl program ro read the contents
of the MANIFEST file in java jar file? We are trying to develop
something to provide comparisons for change between different
implementations. Is this a simple Perl backtic, system or exec of the
jar command or is there a more exotic way to do it? Also, we need to
extract Checksum. But that seems documented.
-- 





  

  
  


  Michael Barto
  Software Architect
  
  
  
  


   LogiQwest
Inc.
16458 Bolsa Chica Street, # 15
Huntington Beach, CA  92649
  http://www.logiqwest.com/
  
  
     
  [EMAIL PROTECTED]
Tel:  714 377 3705
Fax: 714 840 3937
Cell: 714 883 1949
  
  


  'tis a gift to be
simple
   


   This e-mail may contain
LogiQwest
proprietary information and should be treated as confidential.