From 2922f61c1c02803c82e725469764ecd3471ee7a6 Mon Sep 17 00:00:00 2001 From: igoyak Date: Fri, 26 Jun 2015 16:53:26 +0200 Subject: preserve permissions when updating bookmarks. Fix for #59 --- ranger/container/bookmarks.py | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- cgit 1.4.1-2-gfad0 d> mirror of ranger - a simple, vim-like file managerakspecs <akspecs@tilde.institute>
summary refs log tree commit diff stats
path: root/setup.py
blob: 0d72978b9148a5f81e4663dd4925eb8c8578db76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42