Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Digest Number 3251

Expand Messages
  • Mike Flannigan
    On 1/25/2011 7:29 AM, perl-beginner@yahoogroups.com wrote: Archive Zip appears empty in Windows
    Message 1 of 1 , Jan 27, 2011
    • 0 Attachment
      On 1/25/2011 7:29 AM, perl-beginner@yahoogroups.com wrote:


      Archive Zip appears empty in Windows
      <http://groups.yahoo.com/group/perl-beginner/message/27085;_ylc=X3oDMTJyOGRpbWM0BF9TAzk3MzU5NzE1BGdycElkAzEyMjM4NTcEZ3Jwc3BJZAMxNzA1MDA2OTUxBG1zZ0lkAzI3MDg1BHNlYwNkbXNnBHNsawN2bXNnBHN0aW1lAzEyOTU5NjIxOTM->



      Posted by: "twlewis64" twlewis@...
      <mailto:twlewis@...?Subject=%20Re%3A%20Archive%20Zip%20appears%20empty%20in%20Windows>
      twlewis64 <http://profiles.yahoo.com/twlewis64>


      Mon Jan 24, 2011 2:06 pm (PST)


      I am using Archive Zip to compress files in a Windows environment. If I
      open the files through Windows, it shows nothing. I can open the file
      with 7-zip and see the files if go down through the directory layers.
      Why can't Windows see the files?
      Thanks for any help on this.
      My test code is below:

      #!/usr/local/
      bin/perl
      use strict;
      use Archive::Zip qw( :ERROR_CODES );

      my $objZip = Archive::Zip->new();
      my $archiveName = 'C:\Temp\files.zip';
      my @files = ('C:\temp\file1.txt',
      'C:\temp\file2.txt',
      'C:\temp\file3.txt'); # files to store

      foreach my $fileName(@files) {
      print "file is $fileName\n";
      $objZip->addFile($fileName); # add file
      }
      if ($objZip->writeToFileNamed($archiveName) != AZ_OK) {
      # write the file to a zip archive. if it fails then
      # write and error to the logfile
      print "Failed to archive file\n";
      } # end of if

      ___________________________________________________


      That script works perfectly for me (on Win2000)
      and you can see the files when the zip file is opened
      with WinZip.


      Mike Flannigan




      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.