In COPY-FILE, move mode-setting statement after closing of output
authorChris Hanson <org/chris-hanson/cph>
Mon, 19 Dec 1994 21:06:39 +0000 (21:06 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 19 Dec 1994 21:06:39 +0000 (21:06 +0000)
file.  This is required under OS/2, since setting the file modes is
prohibited for a file that is opened for writing.

v7/src/runtime/sfile.scm

index eca51fa47bc4e5e94fe42813ba91a77a07a42fb7..b7607f4b2bebe9a45ea017390302afdb0698a3a5 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: sfile.scm,v 14.14 1994/11/20 05:06:56 cph Exp $
+$Id: sfile.scm,v 14.15 1994/12/19 21:06:39 cph Exp $
 
 Copyright (c) 1988-94 Massachusetts Institute of Technology
 
@@ -98,11 +98,11 @@ MIT in each case. |#
                         (if (= n-read buffer-length)
                             (+ (loop (- source-length buffer-length))
                                buffer-length)
-                            n-read)))))))
-        (set-file-modes! to (file-modes from)))
+                            n-read))))))))
        (lambda ()
         (if output-channel (channel-close output-channel))
-        (if input-channel (channel-close input-channel)))))))
+        (if input-channel (channel-close input-channel)))))
+    (set-file-modes! output-filename (file-modes input-filename))))
 
 (define (file-eq? x y)
   ((ucode-primitive file-eq?) (->namestring (merge-pathnames x))