From 353f82b479d07383872289f1b8a7be06f0a9245a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 26 Oct 1993 21:28:19 +0000 Subject: [PATCH] Disallow renaming or copying a file to an existing file. --- v7/src/edwin/dired.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v7/src/edwin/dired.scm b/v7/src/edwin/dired.scm index 38d931f1b..383ae662f 100644 --- a/v7/src/edwin/dired.scm +++ b/v7/src/edwin/dired.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dired.scm,v 1.137 1993/09/09 04:52:50 cph Exp $ +;;; $Id: dired.scm,v 1.138 1993/10/26 21:28:19 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology ;;; @@ -311,6 +311,8 @@ Type `h' after entering dired for more info." (lambda (to-file) (let ((from (dired-current-pathname)) (to (->pathname to-file))) + (if (file-exists? to) + (editor-error "File already exists: " (->namestring to))) (bind-condition-handler (list condition-type:file-error condition-type:port-error) (lambda (condition) @@ -333,6 +335,8 @@ Type `h' after entering dired for more info." (lambda (to-file) (let ((from (dired-current-pathname)) (to (->pathname to-file))) + (if (file-exists? to-file) + (editor-error "File already exists: " (->namestring to-file))) (bind-condition-handler (list condition-type:file-error condition-type:port-error) (lambda (condition) -- 2.25.1