emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110369: Support setting file times o


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110369: Support setting file times of directories on MS-Windows.
Date: Fri, 05 Oct 2012 11:17:17 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110369
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2012-10-05 11:17:17 +0200
message:
  Support setting file times of directories on MS-Windows.
  
   src/w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
   that time stamps of directories could also be changed.  Don't
   request the too broad GENERIC_WRITE, only the more restrictive
   FILE_WRITE_ATTRIBUTES access rights.
   src/fileio.c (Fset_file_times): Special-case ignoring errors for
   directories only on MSDOS, not on MS-Windows.
modified:
  src/ChangeLog
  src/fileio.c
  src/w32.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-05 07:38:05 +0000
+++ b/src/ChangeLog     2012-10-05 09:17:17 +0000
@@ -1,3 +1,13 @@
+2012-10-05  Eli Zaretskii  <address@hidden>
+
+       * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
+       that time stamps of directories could also be changed.  Don't
+       request the too broad GENERIC_WRITE, only the more restrictive
+       FILE_WRITE_ATTRIBUTES access rights.
+
+       * fileio.c (Fset_file_times): Special-case ignoring errors for
+       directories only on MSDOS, not on MS-Windows.
+
 2012-10-05  Ikumi Keita  <address@hidden>  (tiny change)
 
        * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-09-30 13:43:47 +0000
+++ b/src/fileio.c      2012-10-05 09:17:17 +0000
@@ -3034,7 +3034,7 @@
   {
     if (set_file_times (-1, SSDATA (encoded_absname), t, t))
       {
-#ifdef DOS_NT
+#ifdef MSDOS
         struct stat st;
 
         /* Setting times on a directory always fails.  */

=== modified file 'src/w32.c'
--- a/src/w32.c 2012-10-04 20:07:45 +0000
+++ b/src/w32.c 2012-10-05 09:17:17 +0000
@@ -3952,8 +3952,9 @@
     }
 
   /* Need write access to set times.  */
-  fh = CreateFile (name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
-                  0, OPEN_EXISTING, 0, NULL);
+  fh = CreateFile (name, FILE_WRITE_ATTRIBUTES,
+                  FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                  0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
   if (fh != INVALID_HANDLE_VALUE)
     {
       convert_from_time_t (times->actime, &atime);


reply via email to

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