Hello,
I have as the output of an unzip command called from a script the following:
unzip test.zip
Archive: test.zip
inflating: arch1.txt
inflating: arch2.txt
inflating: arch3.txt
inflating: arch4.txt
inflating: arch5.txt
inflating: arch6.txt
The same I have from a pkware execution :
pkunzip teste.zip
PKZIP(R) Version 6.0 FAST! Compression Utility for Linux X86
Copyright 1989-2002 PKWARE Inc. All Rights Reserved. Evaluation Version
PKZIP Reg. U.S. Pat. and Tm. Off. Patent No. 5,051,745
Extracting files from .ZIP: teste.zip
Inflating: arch1.txt
Inflating: arch2.txt
Inflating: arch3.txt
Inflating: arch4.txt
Inflating: arch5.txt
So, I need some help on how to write a regexp to get the values after inflating, that
is the filenames, and put them in an array. Both outputs above are stored on a $stdout
php variable.
Also, I need to be able to indentify errors with the unzip utility that does not
support some types of zip file, the output is like this:
unzip test1.zip
Archive: test1.zip
skipping: test1.txt `shrink' method not supported
There's a skipping instead of a inflating or Inflating in pkware.
The third situation is an error on the zip file itself :
unzip test2.zip
Archive: test2.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of test2.zip or
test2.zip.zip, and cannot find test2.zip.ZIP, period.
or
pkunzip test2.zip
PKZIP(R) Version 6.0 FAST! Compression Utility for Linux X86
Copyright 1989-2002 PKWARE Inc. All Rights Reserved. Evaluation Version
PKZIP Reg. U.S. Pat. and Tm. Off. Patent No. 5,051,745
Extracting files from .ZIP: test2.zip
Errors were found in .ZIP file, attempt to fix (<Y>es/<N>o)? N
PKZIP: (Z152) No CE signature found
Help is much appreacited.
Thanks in advance.
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>