home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / other / pkginfo / pkgcat.rexx next >
OS/2 REXX Batch file  |  1998-04-23  |  668b  |  23 lines

  1. /* $VER: pkgcat 0.6 $ */
  2. /* concatenate AppleLink package */
  3. /* © by Stefan Haubenthal 1998 */
  4. align=8
  5. if ~arg() then exit 0*writeln(stdout,"Usage: pkgcat name")
  6. parse arg name
  7. if ~open(file2,name"/0") then exit 10
  8. if ~open(file,name".pkg",W) then exit 10
  9. call writech(file,readch(file2,260))
  10. call close(file2)
  11. do i=1
  12.     if ~open(file2,name"/"i) then leave
  13.     len=c2d(readch(file2,3))
  14.     type=readch(file2)
  15.     call seek(file2,4)/* \0\0\0\0 */
  16.     rec=readch(file2,65535)
  17.     say i"    "length(rec)-len+8
  18.     len=length(rec)+8/* correction */
  19.     call writech(file,d2c(len,3)type"00000000"x||rec)
  20.     if len//align>0 then call writech(file,copies("00"x,align-len//align))
  21.     call close(file2)
  22. end
  23.