summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-11-06 16:44:51 +0100
committerhut <hut@lavabit.com>2010-11-06 16:44:51 +0100
commitfe1bf8548f6726ccb741ea2994edeca9085683f1 (patch)
tree248d2eeb279ed64d009494e0b00b6a5e31cf9d02
parent359cfb362c59e658dbffa29ee9cae6cef1065c9f (diff)
downloadranger-fe1bf8548f6726ccb741ea2994edeca9085683f1.tar.gz
fsobject.fsobject: Use ctime, not mtime, for identifying changes
-rw-r--r--ranger/fsobject/fsobject.py7
-rw-r--r--ranger/gui/widgets/statusbar.py12
2 files changed, 10 insertions, 9 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 0e2b46f5..8468839d 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -180,6 +180,7 @@ class FileSystemObject(FileManagerAware):
 		self.loaded = True
 
 		# Get the stat object, either from preload or from [l]stat
+		self.permissions = None
 		new_stat = None
 		path = self.path
 		is_link = False
@@ -275,10 +276,10 @@ class FileSystemObject(FileManagerAware):
 			self.load()
 			return True
 		try:
-			real_mtime = lstat(self.path).st_mtime
+			real_ctime = lstat(self.path).st_ctime
 		except OSError:
-			real_mtime = None
-		if not self.stat or self.stat.st_mtime != real_mtime:
+			real_ctime = None
+		if not self.stat or self.stat.st_ctime != real_ctime:
 			self.load()
 			return True
 		return False
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index fb3e6b21..dc169af2 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -39,7 +39,7 @@ class StatusBar(Widget):
 	msg = None
 
 	old_cf = None
-	old_mtime = None
+	old_ctime = None
 	old_du = None
 	old_hint = None
 	result = None
@@ -79,9 +79,9 @@ class StatusBar(Widget):
 				self.need_redraw = True
 
 		try:
-			mtime = self.env.cf.stat.st_mtime
+			ctime = self.env.cf.stat.st_ctime
 		except:
-			mtime = -1
+			ctime = -1
 
 		if not self.result:
 			self.need_redraw = True
@@ -94,8 +94,8 @@ class StatusBar(Widget):
 			self.old_cf = self.env.cf
 			self.need_redraw = True
 
-		if self.old_mtime != mtime:
-			self.old_mtime = mtime
+		if self.old_ctime != ctime:
+			self.old_ctime = ctime
 			self.need_redraw = True
 
 		if self.need_redraw:
@@ -176,7 +176,7 @@ class StatusBar(Widget):
 			left.add_space()
 
 			left.add(strftime(self.timeformat,
-					localtime(stat.st_mtime)), 'mtime')
+					localtime(stat.st_ctime)), 'mtime')
 
 	def _get_owner(self, target):
 		uid = target.stat.st_uid
vision' href='/akspecs/ranger/blame/doc/ranger.gui.widgets.html?h=v1.9.0b3&id=4e01caf19cfbc798862e6b8b2dbd77328c8f99a2'>^
34a60763 ^
f07bb12f ^









4c13e1f2 ^

f07bb12f ^


4c13e1f2 ^

f07bb12f ^



4c13e1f2 ^


f07bb12f ^











f07bb12f ^















4c13e1f2 ^




34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^



f07bb12f ^
34a60763 ^
f07bb12f ^


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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142