home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 8 / boot-disc-1997-04.iso / PDA_Soft / Psion / utils / S3Uzip15 / APPNOTES.TXT next >
Text File  |  1995-11-24  |  2KB  |  78 lines

  1. Invoking UNZIP.IMG from external applications
  2.  
  3. The main enhancement in version 1.4 is that it allows the
  4. destination directory (where the extracted files will be placed)
  5. to be specified on the command line. This is useful where Unzip
  6. is being spawned by a parent process, rather than run
  7. interactively using the RUN.APP utility.
  8.  
  9. The syntax for specifying the destination directory is as follows:
  10.  
  11.   m:\run\unzip.img [options] -@ m:\destin\dir\  zipfilename
  12.  
  13. The -@ switch (chosen so as to be unlikely to conflict with
  14. switches for other platforms) must be used as follows:
  15.  
  16.   1) It must be the *last* of any options on the command line.
  17.  
  18.   2) It must be followed by (at least one) space, then the full
  19.      path name of the destination directory.
  20.  
  21.   3) The destination directory must exist already.
  22.  
  23.   4) The destination directory name must be terminated with a
  24.      backslash (EPOC requires this).
  25.  
  26. Example command line:
  27.  
  28.   -qq -@ m:\tmp\ a:\zipfile.zip
  29.  
  30. unzips quietly the zip file on drive A to the \tmp directory of
  31. the internal drive.
  32.  
  33.  
  34. Invoking UNZIP.IMG from C or C++
  35.  
  36.   #include <plib.h>
  37.   /* This assumes PLIB is in use, change as required for CLIB */
  38.  
  39.   int pid;
  40.   char name[64];
  41.   char cmdl[128];
  42.  
  43.   p_scpy(name, "m:\\run\\unzip.img"); /* Or wherever Unzip is located */
  44.   p_scpy(cmdl, "command line to be passed");
  45.   pid = p_execc(name, cmdl, p_slen(cmdl));
  46.   if (pid<0)
  47.     p_notifyerr(pid, "Unzip launch failed", NULL, NULL, NULL);
  48.   else
  49.     p_presume(pid);
  50.  
  51.  
  52. Invoking UNZIP.IMG from OPL
  53.  
  54.   #ifdef S3A
  55.   #define UADD(x,y) uadd(x,y)
  56.   #else
  57.   #define UADD(x,y) (x+y)
  58.   #endif
  59.  
  60.   local pid%, ret%
  61.   local name$(64), cmdl$(128)
  62.  
  63.   name$="m:\run\unzip.img"+chr$(0)  REM Or wherever Unzip is located
  64.   cmdl$="command line to be passed"+chr$(0)
  65.   ret%=call($0187,UADD(addr(name$),1),addr(cmdl$),0,0,addr(pid%))
  66.   if ret%<0
  67.     alert("Unzip launch failed",err$(ret%))
  68.   else
  69.     call($0688,pid%,0,0,0,0)  REM Resume process
  70.   endif
  71.  
  72. -------------
  73. David Palmer
  74. Edinburgh
  75. Scotland
  76. September, 1995
  77.  
  78.