emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fileio.c


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/fileio.c
Date: Sat, 09 Mar 2002 05:16:41 -0500

Index: emacs/src/fileio.c
diff -c emacs/src/fileio.c:1.440 emacs/src/fileio.c:1.441
*** emacs/src/fileio.c:1.440    Sun Mar  3 16:55:33 2002
--- emacs/src/fileio.c  Fri Mar  8 19:35:13 2002
***************
*** 2409,2420 ****
    else if (NILP (keep_time))
      {
        EMACS_TIME now;
        EMACS_GET_TIME (now);
!       if (set_file_times (XSTRING (encoded_newname)->data,
!                         now, now))
!       Fsignal (Qfile_date_error,
!                Fcons (build_string ("Cannot set file date"),
!                       Fcons (newname, Qnil)));
      }
  #else /* not WINDOWSNT */
    ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0);
--- 2409,2433 ----
    else if (NILP (keep_time))
      {
        EMACS_TIME now;
+       DWORD attributes;
+       char * filename;
+ 
        EMACS_GET_TIME (now);
!       filename = XSTRING (encoded_newname)->data;
! 
!       /* Ensure file is writable while its modified time is set.  */
!       attributes = GetFileAttributes (filename);
!       SetFileAttributes (filename, attributes ^ FILE_ATTRIBUTE_READONLY);
!       if (set_file_times (filename, now, now))
!       {
!         /* Restore original attributes.  */
!         SetFileAttributes (filename, attributes);
!         Fsignal (Qfile_date_error,
!                  Fcons (build_string ("Cannot set file date"),
!                         Fcons (newname, Qnil)));
!       }
!       /* Restore original attributes.  */
!       SetFileAttributes (filename, attributes);
      }
  #else /* not WINDOWSNT */
    ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]