home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / pgprex12.arj / PGPREXX.ZIP / nul2spac.cmd < prev    next >
Encoding:
Text File  |  1996-08-09  |  972 b   |  36 lines

  1. /* REXX NUL2SPAC.CMD
  2.  
  3.     This program changes any NUL to a SPACE.
  4.  
  5.     Post Road Mailer 1.99 and 2.00 introduced a problem which makes the first part
  6. or even all of the PGP output appended to a mail file invisible when you VIEW the
  7. mail (the problem does not occur with printing or with quoting in a reply).
  8.     There is a NUL character near the end of the mail file which makes PRM stumble.
  9. This simple REXX script serves to change this NUL into a SPACE
  10. */
  11. ARG FileIn .
  12.  
  13. call RxFuncAdd 'SysTempFileName', 'RexxUtil', 'SysTempFileName'
  14.  
  15. Tempfile = SysTempFileName('NUL?????.TMP')
  16. Erg = STREAM(FileIn,'C','OPEN READ')
  17. Erg = STREAM(Tempfile,'C','OPEN WRITE')
  18.  
  19. Say 'Eingabe: ' FileIn
  20. Say 'Ausgabe: ' FileIn
  21.  
  22. DO WHILE LINES(FileIn) > 0
  23.    Erg = LINEOUT(TempFile,TRANSLATE(LINEIN(FileIn),'20'x,'00'x))
  24. END /* DO While */
  25.  
  26. Erg = STREAM(FileIn,'C','CLOSE')
  27. Erg = STREAM(TempFile,'C','CLOSE')
  28.  
  29.  
  30. 'COPY ' TempFile FileIn
  31. 'del ' TempFile
  32.  
  33. EXIT
  34.  
  35. 
  36.