×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Archive::Zip won't extract files?

Archive::Zip won't extract files?

Archive::Zip won't extract files?

(OP)
Hi,

Does anyone know why Archive::Zip is giving me a successful return code, saying it has extracted the files but it hasn't?

here is my code

CODE

    my $zip = Archive::Zip->new( "$upload_dir/$filename" );    
    my @names = $zip->memberNames;
    
    # loop files
    foreach my $name (@names) {
         $zip->extractMemberWithoutPaths($name);
    }

I've tried using just $zip->member , makes no differrence?

I get a zero returned from each extract, which is successful, but the files do not get extracted?

Any ideas?

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Electronic Dance Music Downloads

RE: Archive::Zip won't extract files?

(OP)
I seemed to have solved it by including the path even though you are not meant to do this as it is suppose to extract to the current location of the zip?

this works...

CODE

$zip->extractMemberWithoutPaths($name,"$upload_dir/$name");

 

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Electronic Dance Music Downloads

RE: Archive::Zip won't extract files?

Hi, good to know you figured it out.

In the past I worked with winzip using command line and it worked very well.  I amposting this as a reference.

Below the Winzip command line parameters.

CODE


What command line parameters does WinZip support?
Below is some information about the undocumented command line options for using the WinZip program module, winzip32.exe.

WinZip supports command line options to add and extract from files. Be sure to read the Notes section below for additional important information.

Adding Files
The command format is:

    winzip32 [-min] action [options] filename[.zip] files

where:
-min specifies that WinZip should run minimized. If -min is specified, it must be the first command line parameter.

action
-a for add, -f for freshen, -u for update, and -m for move. You must specify one (and only one) of these actions. The actions correspond to the actions described in the section titled "Add dialog box options" in the online manual.

options
-r corresponds to the Include subfolders checkbox in the Add dialog and causes WinZip to add files from subfolders. Folder information is stored for files added from subfolders. If you add -p, WinZip will store folder information for all files added, not just for files from subfolders; the folder information will begin with the folder specified on the command line.

-ex, -en, -ef, -es, and -e0 determine the compression method: eXtra, Normal, Fast, Super fast, and no compression. The default is "Normal". -hs includes hidden and system files. Use -sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password".

filename.zip
Specifies the name of the Zip file involved. Be sure to use the full filename (including the folder).

files
Is a list of one or more files, or the @ character followed by the filename containing a list of files to add, one filename per line. Wildcards (e.g. *.bak) are allowed.

Extracting Files
The command format is:

    winzip32 -e [options] filename[.zip] folder
where -e is required.
options
-o and -j stand for "Overwrite existing files without prompting" and "Junk pathnames", respectively. Unless -j is specified, folder information is used. Use -sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password".

filename.zip
Specifies the name of the Zip file involved. Be sure to specify the full filename (including the folder).

folder
Is the name of the folder to which the files are extracted. If the folder does not exist it is created.


Notes
VERY IMPORTANT: always specify complete filenames, including the full folder name and drive letter, for all file IDs.

To run WinZip in a minimized inactive icon use the "-min" option. When specified this option must be the first option.

Only operations involving the built-in zip and unzip are supported.

Enclose long filenames in quotes.

When using a list ("@") file, no leading or trailing spaces should appear in file IDs in the list.

The action and each option must be separated by at least one space.

WinZip can be used to compress files with cc:Mail . Change the compress= line in the [cc:Mail] section of the appropriate WMAIL.INI files to specify the full path for WinZip followed by "-a %1 @%2". For example, if WinZip is installed in your c:\winzip folder, specify
    compress=c:\winzip\winzip.exe -a %1 @%2

dmazzini
GSM/UMTS System and Telecomm Consultant

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close