about 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-22 02:34:32 +0100
commitf05a2eda194142de77a62acb12fecc2ec6386c48 (patch)
treeba9e523079e86d093cd36ff751c83ce69d8ad830
parent6a7c1b84604cb378b6e82ed616776db0a89f5dcb (diff)
downloadranger-f05a2eda194142de77a62acb12fecc2ec6386c48.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 4ca5a6c8..6e18d0e3 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -169,6 +169,7 @@ class FileSystemObject(MimeTypeAware, 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
@@ -264,10 +265,10 @@ class FileSystemObject(MimeTypeAware, 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 3019930b..6fff7383 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