summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/bookmarks.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index 5f163e89..cbb95864 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -156,6 +156,12 @@ class Bookmarks(object):
                         pass
 
             f.close()
+            old_perms = os.stat(self.path)
+            try:
+                os.chown(self.path+".new", old_perms.st_uid, old_perms.st_gid)
+                os.chmod(self.path+".new", old_perms.st_mode)
+            except OSError:
+                pass
             os.rename(self.path+".new", self.path)
         self._update_mtime()
 
all python files' href='/akspecs/ranger/commit/examples/plugin_chmod_keybindings.py?h=v1.7.0-emacs&id=d1a1173ddc315f21a3d468f43ac55aa43d31883d'>d1a1173d ^
972da7ba ^
d1a1173d ^





972da7ba ^
ca1a5d21 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18