home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / autorep3.zip / AppendLock.cmd next >
OS/2 REXX Batch file  |  1996-03-12  |  705b  |  34 lines

  1. /* ------------------------------------------------------------------ */
  2.  
  3. TRUE = 1
  4. FALSE = 0
  5.  
  6. AppendLock: 
  7.  
  8. parse arg SrcFile DestFile
  9.  
  10.  
  11. rc = LockOpen(SrcFile 'READ')
  12. if rc = FALSE then
  13.   return FALSE
  14.  
  15. rc = LockOpen(DestFile 'WRITE')
  16. if rc = FALSE then do
  17.   rc = UnLock(SrcFile)
  18.   return FALSE
  19.   end
  20.  
  21. rc = stream(DestFile, 'C', 'SEEK <0')      /* go to end of file */
  22.  
  23. do while lines(SrcFile) <> 0         /* until end of file */
  24.   Line = linein(SRcFile)             /* get a line of the file */
  25.   rc = lineout(DestFile, Line, )
  26.   end
  27.  
  28. rc = LockClose(SrcFile)
  29. rc = LockClose(DestFile)
  30.  
  31. return TRUE
  32.  
  33. /* ------------------------------------------------------------------ */
  34.