Board index » delphi » Errorllevel code / ZIP file testing

Errorllevel code / ZIP file testing

Hi. As part of a program I am writing, I have to scan .ZIP files to see
whether they contain any errors or not.

The way I do this (from Pascal) is to use the exec command as follows :

  ...
  swapvectors
  exec(getenv('COMSPEC'), '/C pkunzip -t ' + zipname);
  swapvectors
  if DosExitCode <> 0 then do_error;
  ....

I had been told that PKUnzip returned a non-zero errorlevel if an error was
found in the .ZIP file.

This piece of code worked great on my machine, but when transferred to a
friends machine for testing, it failed to return (or pick up on) any error
level set by PKUnzip.

The only difference between the two machines is that I am using NDOS, and he
is using MS-DOS 6.0.

We tried running NDOS on his machine, and it worked.

I can only conclude that Turbo Pascal doesnt pick up on errorlevel codes
properly under MS-DOS. Does anyone know of any other way to test the integrity
of a .ZIP file using Pascal?

Thanks....

Danny
dan...@nye1.demon.co.uk

 

Re:Errorllevel code / ZIP file testing


Daniel John Nye (dan...@nye1.demon.co.uk) wrote:
: Hi. As part of a program I am writing, I have to scan .ZIP files to see
: whether they contain any errors or not.
: The way I do this (from Pascal) is to use the exec command as follows :
:   ...
:   swapvectors
:   exec(getenv('COMSPEC'), '/C pkunzip -t ' + zipname);
:   swapvectors
:   if DosExitCode <> 0 then do_error;
:   ....

   The error code that you are picking up is the one for COMMAND.COM and not
PKUNZIP. To pick up the correct code you would need to use something similar
to the following (I believe) :

...
swapvectors;
exec('PKUNZIP', '-t' + zipname);
swapvectors;
if (DosExitCode <> 0) then do_error;
...

: I had been told that PKUnzip returned a non-zero errorlevel if an error was
: found in the .ZIP file.
: This piece of code worked great on my machine, but when transferred to a
: friends machine for testing, it failed to return (or pick up on) any error
: level set by PKUnzip.
: The only difference between the two machines is that I am using NDOS, and he
: is using MS-DOS 6.0.
: We tried running NDOS on his machine, and it worked.
: I can only conclude that Turbo Pascal doesnt pick up on errorlevel codes
: properly under MS-DOS. Does anyone know of any other way to test the integrity
: of a .ZIP file using Pascal?
: Thanks....
: Danny
: dan...@nye1.demon.co.uk

                             Michael

E-mail: M.D.Ro...@student.lut.ac.uk

Other Threads