X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Cesar Rabak Newsgroups: comp.os.msdos.djgpp Subject: Re: calling unzip32 from djgpp Date: Mon, 20 Sep 2004 15:38:32 -0300 Lines: 78 Message-ID: <414F23A8.8060709@acm.org> References: <42da7100 DOT 0409200153 DOT 6cb9560f AT posting DOT google DOT com> <414ECC5B DOT 7000802 AT acm DOT org> <42da7100 DOT 0409201030 DOT 753ea573 AT posting DOT google DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de xXpHUT3Se4NYMlZ8zXFO8w8XuGlzbikZZQe6XTCzAdGTPYFwo= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: pt-br, pt To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com rafael garcia escreveu: > Cesar Rabak wrote in message news:<414ECC5B DOT 7000802 AT acm DOT org>... > >>>@unzip32 -o %1 >>>@if errorlevel 1 echo UNZIP32 COULD NOT TERMINATE CORRECTLY >>>@rem I don't know why this message appears only if called >>>@rem from system() but not from console >>> >> >>If I call the above bat file from a C program as follows: >> >>#include >> >>int >>main(void) >>{ >> system("prueba.bat"); >> return 0; >>} >> >>I get the same results be it calling the bat file ("prueba.bat") or the >>compiled program. >> >>HTH > > > I have being got confused because my program obtains filenames to > decompress programatically and they come with complete path, including > extension, while when I call the BAT from console I don't give the > extension. So: > > c:\c>unzip32 -o prueba > Archive: prueba.zip > extracting: ./prueba.txt > c:\c>echo %errorlevel% > 0 > c:\c>unzip32 -o prueba.zip > Archive: prueba.zip > extracting: ./prueba.txt > c:\c>echo %errorlevel% > 1 <------------------ !!!!! > > The problem is when you include the ".zip" file extension, unzip32.exe > changes its return code to 1 !!! > > I don't know if this is a bug or a feature but it has bad colour for > me. > From the unzip man page: . . . DIAGNOSTICS The exit status (or error level) approximates the exit codes defined by PKWARE and takes on the following values, except under VMS: 0 normal; no errors or warnings detected. 1 one or more warning errors were encountered, but processing completed successfully any- way. This includes zipfiles where one or more files was skipped due to unsupported compression method or encryption with an unknown password. The man page shows a lot of other exit codes up to 82. HTH -- Cesar Rabak