Bug 899436 - OS.File lastModificationDate is erroneously returning lastAccessDate on Windows. r=yoric
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 31 Jul 2013 12:02:26 +1000
changeset 148305 5e5bb1036572c60073039330a3b82f5ea78157dd
parent 148304 393828fbbfb161a7c6cde1f1e973693d5e5904f6
child 148306 d8715e2c8b5570c9b601ceb336a9e73fad010383
push id4085
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 20:29:25 +0000
treeherdermozilla-aurora@ede8780a15bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric
bugs899436
milestone25.0a1
Bug 899436 - OS.File lastModificationDate is erroneously returning lastAccessDate on Windows. r=yoric
toolkit/components/osfile/osfile_win_allthreads.jsm
toolkit/components/osfile/osfile_win_front.jsm
--- a/toolkit/components/osfile/osfile_win_allthreads.jsm
+++ b/toolkit/components/osfile/osfile_win_allthreads.jsm
@@ -185,23 +185,23 @@ if (typeof Components != "undefined") {
   exports.OS.Shared.Win.Error = OSError;
 
   /**
    * Code shared by implementation of File.Info on Windows
    *
    * @constructor
    */
   let AbstractInfo = function AbstractInfo(isDir, isSymLink, size, winBirthDate,
-                                           lastAccessDate) {
+                                           lastAccessDate, lastWriteDate) {
     this._isDir = isDir;
     this._isSymLink = isSymLink;
     this._size = size;
     this._winBirthDate = winBirthDate;
     this._lastAccessDate = lastAccessDate;
-    this._lastModificationDate = lastAccessDate;
+    this._lastModificationDate = lastWriteDate;
   };
 
   AbstractInfo.prototype = {
     /**
      * |true| if this file is a directory, |false| otherwise
      */
     get isDir() {
       return this._isDir;
--- a/toolkit/components/osfile/osfile_win_front.jsm
+++ b/toolkit/components/osfile/osfile_win_front.jsm
@@ -685,22 +685,24 @@
       * @constructor
       */
      File.Info = function Info(stat) {
        let isDir = !!(stat.dwFileAttributes & Const.FILE_ATTRIBUTE_DIRECTORY);
        let isSymLink = !!(stat.dwFileAttributes & Const.FILE_ATTRIBUTE_REPARSE_POINT);
        
        let winBirthDate = FILETIME_to_Date(stat.ftCreationTime);
        let lastAccessDate = FILETIME_to_Date(stat.ftLastAccessTime);
+       let lastWriteDate = FILETIME_to_Date(stat.ftLastWriteTime);
 
        let value = ctypes.UInt64.join(stat.nFileSizeHigh, stat.nFileSizeLow);
        let size = exports.OS.Shared.Type.uint64_t.importFromC(value);
 
        exports.OS.Shared.Win.AbstractInfo.call(this, isDir, isSymLink, size,
-                                               winBirthDate, lastAccessDate);
+                                               winBirthDate, lastAccessDate,
+                                               lastWriteDate);
      };
      File.Info.prototype = Object.create(exports.OS.Shared.Win.AbstractInfo.prototype);
 
      /**
       * Return a version of an instance of File.Info that can be sent
       * from a worker thread to the main thread. Note that deserialization
       * is asymmetric and returns an object with a different implementation.
       */