home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxgzlib.zip / rxgunzip.cmd < prev    next >
OS/2 REXX Batch file  |  1999-12-20  |  853b  |  35 lines

  1. /* Load the rxgZlib functions */
  2. if rxfuncquery('rxgzLoadFuncs') then do
  3.    foo=RxFuncAdd( 'rxgzLoadFuncs', 'RXGZLIB', 'rxgzLoadFuncs')
  4.    if foo=0 then do
  5.       call rxgzLoadFuncs
  6.    end
  7.    else do
  8.       say "Sorry, rxGZlib.dll is not available"
  9.       exit
  10.    end /* do */
  11. end /* if */
  12.  
  13. input_file=''
  14. output_file=''
  15.  
  16. parse arg input_file output_file .
  17.  
  18. if input_file='' | output_file='' then do
  19.    say "UnGZIP a file, using rxGZlib procedures."
  20.    say 'Syntax: rxgunzip <input_file.gz> <output_file>'
  21.    exit (1)
  22. end /* if */
  23.  
  24. rc = stream(input_file, 'c', 'open read')
  25. agzstr = charin(input_file, 1, chars(input_file))
  26. rc = stream(input_file, 'c', 'close')
  27.  
  28. thestr2 = rxgzInflateString(agzstr)
  29.  
  30. rc = stream(output_file, 'c', 'open write')
  31. rc = charout(output_file, thestr2, 1)
  32. rc = stream(output_file, 'c', 'close')
  33.  
  34.  
  35.