changeset 17271:e34a30952e14

(Fcopy_file): Use Qfile_date_error if can't set file date. (Qfile_date_error): New variable. (syms_of_fileio): Set it up.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Apr 1997 04:25:04 +0000
parents 8899e9305c25
children 5dd977f51652
files src/fileio.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Mon Mar 31 22:46:25 1997 +0000
+++ b/src/fileio.c	Tue Apr 01 04:25:04 1997 +0000
@@ -207,7 +207,7 @@
 static Lisp_Object Vinhibit_file_name_handlers;
 static Lisp_Object Vinhibit_file_name_operation;
 
-Lisp_Object Qfile_error, Qfile_already_exists;
+Lisp_Object Qfile_error, Qfile_already_exists, Qfile_date_error;
 
 Lisp_Object Qfile_name_history;
 
@@ -2129,7 +2129,9 @@
 	  EMACS_SET_SECS_USECS (atime, st.st_atime, 0);
 	  EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
 	  if (set_file_times (XSTRING (newname)->data, atime, mtime))
-	    report_file_error ("I/O error", Fcons (newname, Qnil));
+	    Fsignal (Qfile_date_error,
+		     Fcons (build_string ("File already exists"),
+			    Fcons (absname, Qnil)));
 	}
 #ifndef MSDOS
       chmod (XSTRING (newname)->data, st.st_mode & 07777);
@@ -4789,6 +4791,8 @@
   staticpro (&Qfile_error);
   Qfile_already_exists = intern ("file-already-exists");
   staticpro (&Qfile_already_exists);
+  Qfile_date_error = intern ("file-date-error");
+  staticpro (&Qfile_date_error);
 
 #ifdef DOS_NT
   Qfind_buffer_file_type = intern ("find-buffer-file-type");
@@ -4821,6 +4825,12 @@
   Fput (Qfile_already_exists, Qerror_message,
 	build_string ("File already exists"));
 
+  Fput (Qfile_date_error, Qerror_conditions,
+	Fcons (Qfile_date_error,
+	       Fcons (Qfile_error, Fcons (Qerror, Qnil))));
+  Fput (Qfile_date_error, Qerror_message,
+	build_string ("Cannot set file date"));
+
   DEFVAR_BOOL ("insert-default-directory", &insert_default_directory,
     "*Non-nil means when reading a filename start with default dir in minibuffer.");
   insert_default_directory = 1;