On Sunday 01 August 2004 08:07, C.F. Scheidecker Antunes wrote: > In order to get the filenames from the output below I have tried the > following: > > preg_match_all('/inflating:"(.*?)"/', $stdout, $matches); > print_r($matches); > return $matches[1]; > > But I only get empty arrays with it.
Try: preg_match_all('|^\sinflating: (.*)$|m', $stdout, $matches); [snip] > 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. You can modify the above regex to do this. > The third situation is an error on the zip file itself : If you simply want to detect whether an error has occurred then using exec() you can get the exit code of the program being executed and usually would indicate any errors. Otherwise you can use the string search functions to look for common/expected error messages in $stdout. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* There comes a time to stop being angry. -- A Small Circle of Friends */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php