couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [4/8] couch commit: updated refs/heads/master to 78f575e
Date Thu, 28 Apr 2016 16:26:10 GMT
Explicitly update mtime of the renamed files


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/cc30705d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/cc30705d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/cc30705d

Branch: refs/heads/master
Commit: cc30705d891fcf36ee17a889d012afd451b2f222
Parents: f8432a1
Author: Eric Avdey <eiri@eiri.ca>
Authored: Fri Apr 22 11:15:01 2016 -0300
Committer: Eric Avdey <eiri@eiri.ca>
Committed: Thu Apr 28 13:09:35 2016 -0300

----------------------------------------------------------------------
 src/couch_file.erl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/cc30705d/src/couch_file.erl
----------------------------------------------------------------------
diff --git a/src/couch_file.erl b/src/couch_file.erl
index 9a9c070..37923da 100644
--- a/src/couch_file.erl
+++ b/src/couch_file.erl
@@ -246,7 +246,11 @@ delete_file(RootDir, Filepath, Async) ->
 
 rename_file(Original) ->
     DeletedFileName = deleted_filename(Original),
-    file:rename(Original, DeletedFileName).
+    Now = calendar:local_time(),
+    case file:rename(Original, DeletedFileName) of
+        ok -> file:change_time(DeletedFileName, Now);
+        Else -> Else
+    end.
 
 deleted_filename(Original) ->
     {{Y, Mon, D}, {H, Min, S}} = calendar:universal_time(),


Mime
View raw message