X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <414B140F.98A3CCF4@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: calling unzip32 from C program References: <2r0dd4F14ift1U1 AT uni-berlin DOT de> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 36 Date: Fri, 17 Sep 2004 17:25:02 GMT NNTP-Posting-Host: 12.76.134.54 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1095441902 12.76.134.54 (Fri, 17 Sep 2004 17:25:02 GMT) NNTP-Posting-Date: Fri, 17 Sep 2004 17:25:02 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker wrote: > Rafael García wrote: > >> I put this in a C program: > >> ret=system("unzip prueba.zip"); > >> then I write an "unzip.bat" with: > >> unzip32 %1 %2 %3 %4 %5 %6 > >> At execution, unzip32 works OK but return value from system is 1. >> When I execute unzip.bat from the console, errorlevel from unzip32 >> is 0 but when called from system in the C program, it returns 1. > > If you ever want to look at return codes (called "ERRORLEVEL" only > by MS command line interpreters...), don't go through a .bat file. > Command.com has an unbelievably stupid feature: it won't tell you > anything about return levels of batch files, or of the programs > they executed. > > For the case at hand, there's really nothing to be gained by having > that .bat file --- you could, and should, run unzip32.exe itself, > directly from your C program, or rename/copy unzip32.exe to > unzip.exe, if it's just the name "unzip" you're after. I believe that using 4dos will allow you to do all those things via a .btm file. -- "This is a wonderful answer. It's off-topic, it's incorrect, and it doesn't answer the question." -- Richard Heathfield "I support the Red Sox and any team that beats the Yankees"