home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- #
- # File: fcopy.icn
- #
- # Subject: Procedure to copy a file
- #
- # Author: Robert J. Alexander
- #
- # Date: September 7, 1990
- #
- ###########################################################################
- #
- # Copies a file named fn1 to file named fn2.
- #
- ############################################################################
-
- procedure fcopy(fn1,fn2) # fn2
- local f1, f2, buf
-
- f1 := open(fn1,"ru") | stop("Can't open ",fn1)
- f2 := open(fn2,"wu") | stop("Can't open ",fn2," for writing")
- while buf := reads(f1,512) do writes(f2,buf)
- every close(f2 | f1)
- return fn2
- end
-