home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / FCOPY.ICN < prev    next >
Text File  |  1991-07-13  |  670b  |  26 lines

  1. ############################################################################
  2. #
  3. #    Name:    fcopy.icn
  4. #
  5. #    Title:    Copy a file
  6. #
  7. #    Author:    Robert J. Alexander
  8. #
  9. #    Date:    September 7, 1990
  10. #
  11. ############################################################################
  12. #
  13. #  Copies a file named fn1 to file named fn2.
  14. #
  15. ############################################################################
  16.  
  17. procedure fcopy(fn1,fn2) # fn2
  18.    local f1, f2, buf
  19.  
  20.    f1 := open(fn1,"ru") | stop("Can't open ",fn1)
  21.    f2 := open(fn2,"wu") | stop("Can't open ",fn2," for writing")
  22.    while buf := reads(f1,512) do writes(f2,buf)
  23.    every close(f2 | f1)
  24.    return fn2
  25. end
  26.