Yup. I knew that was a problem. Anyway. This is to let everyone know that the issue has been resolved. Here is the latest code.
Please excuse the other fodder in the script (stuff at the top) I am working on the rest of the script now.
#!/usr/bin/perl -w use Archive::Zip qw( :CONSTANTS ); use POSIX; use File::Basename; use File::Copy; use strict; ############################################################## # # $Author: $ # $Date: $ # $Locker: $ # # When - 28 Mar 2001 # Purpose - (sensored) # ## MANY thanks to Ned Konz. He is the author and maintainer ## of the Archive::Zip module. He was integral in assisting ## me in getting this blasted thing to work the way I needed ## it to work. ## # # History: # # TODO: # ############################################################## my $sandbox = "/tmp/sandbox"; opendir(D,"$sandbox") or warn("Could not open $sandbox\n"); my @FILES = grep(/(\.EXE)/,readdir(D)) or die("Read error in $sandbox +at line " . __LINE__ . "\n");; close(D); chdir("$sandbox"); for ( @FILES ) { my $file = $_ ; my $unzip = Archive::Zip->new("$file"); warn("Read error in $file at line " . __LINE__ . "!\n") if ( ! def +ined($unzip) ) and next; foreach my $member ( $unzip->members() ) { print "**** File to be extracted: " . $member->fileName() . "\n"; warn("Hmm, there was a problem\n") if ( !defined($member->extractToFileNamed( "$sandbox/" . $memb +er->fileName() )) ); } } 0
Many thanks to the maintainer and author of the Archive::Zip module. Ned Konz was very helpful.

The above code successfully unzips files without directories in the archive. So this will only work on archives that are meant to be unzipped in the destination directory which the archive would currently be located in.

The way I have the script written is it will only find files that are named *.EXE because the project that I am working with has files named *.EXE that are pkzip self-extractable archives. I am only working in a Unix environment (solaris 7) and I know for a fact where these files are coming from and what they should be. If they fail, I will contact the provisioner of these files to redistribute them to my company.

That all being said, I again appreciate the assistance I received here today.

- Jim

Edit 2001-03-28 by tye to replace <pre> with <code>


In reply to Re: Re: extracting self-extracting pkzipped files with Archive::Zip by snafu
in thread extracting self-extracting pkzipped files with Archive::Zip by snafu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.