home *** CD-ROM | disk | FTP | other *** search
- ;;; --------------------------------------------------------------------------;
- ;;; FCOPY.LSP
- ;;; (C) ¬⌐┼v 1988-1992 Autodesk ñ╜Ñq
- ;;;
- ;;; Ñ╗╡{ªíñwÑ╤ Autodesk ñ╜Ñq╡∙ÑU¬⌐┼v, ╢╚⌐≤ñU¡z▒í¬pñUÑi▒┬╗P▒zíu│\ÑiívíC
- ;;; ╗╒ñUñú▒oÑHÑ⌠ª≤º╬ªí╡oªµ⌐╬ÑX¬⌐ª╣╡{ªí¬║íu¡∞⌐l╜Xív; ª²ñ╣│\▒zªb»S⌐w¡lÑ═
- ;;; ¬║ñuº@ñW╡▓ªXª╣╡{ªí¬║íuÑ╪¬║╜Xív¿╧Ñ╬íCª│├÷│o├■¡lÑ═ñuº@¬║▒°Ñ≤ªpñU:
- ;;;
- ;;; ( i) │]¡pñW╗Pñuº@ñW¼╥»┬║Θ░w╣∩ Autodesk ñ╜Ñq¬║▓ú½~íC
- ;;; (ii) ╕ⁿª│íu¬⌐┼v (C) 1988-1992 Autodesk ñ╜Ñqív¬║¬⌐┼v│qºiíC
- ;;;
- ;;;
- ;;;
- ;;; AUTODESKñ╜Ñq┤ú¿╤ª╣╡{ªí╢╚¿╤º@íu├■ªⁿív¬║░╤ª╥, ª╙ÑBñú▒╞░úª│Ñ⌠ª≤┐∙╗~¬║
- ;;; Ñi»αíCAUTODESKñ╜Ñq»Sª╣º_╗{Ñ⌠ª≤»S⌐wÑ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºt
- ;;; ÑX¿π¬║½O├╥íCAUTODESKñ╜ÑqªP«╔ÑτñúÑX¿πª╣╡{ªí░⌡ªµ«╔ñ@⌐wñú╖|íuññ┬_ív⌐╬
- ;;; íuº╣Ñ■╡L╗~ív¬║½O├╥íC
- ;;;
- ;;;
- ;;; --------------------------------------------------------------------------;
- ;;; DESCRIPTION
- ;;;
- ;;; This is a programming example.
- ;;;
- ;;; This program takes two ASCII files as arguments, and copies the first
- ;;; file into the second. If the first file does not exist, an error message
- ;;; is printed, however, if the second file does not exist, it is created.
- ;;;
- ;;; Note that if the second file exists, its data will be overwritten.
- ;;;
- ;;; Usage: (fcopy "infile.ext" "outfile.ext")
- ;;;
- ;;; --------------------------------------------------------------------------;
-
- (defun fcopy (in out / ifp ofp l)
- (cond ((null (setq ifp (open in "r"))) ; try to open in for reading
- (princ "╡L¬k╢}▒╥íu") ; if nil print error message
- (princ in)
- (princ "ívÑH¿╤┼¬¿·íC ")
- )
- (if ifp
- (progn
- (setq ofp (open out "w")) ; else open out for writing
- (while (setq l (read-line ifp)) ; read each line from in
- (write-line l ofp) ; and write it to out
- )
- (close ofp) ; close both files
- (close ifp)
- )
- )
- )
- (princ)
- )
-
- ;;; --------------------------------------------------------------------------;
-
-
-