You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ei...@apache.org on 2016/04/28 18:26:10 UTC

[4/8] couch commit: updated refs/heads/master to 78f575e

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 <ei...@eiri.ca>
Authored: Fri Apr 22 11:15:01 2016 -0300
Committer: Eric Avdey <ei...@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(),