summary refs log tree commit diff stats
path: root/ranger
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 /ranger
parent359cfb362c59e658dbffa29ee9cae6cef1065c9f (diff)
downloadranger-fe1bf8548f6726ccb741ea2994edeca9085683f1.tar.gz
fsobject.fsobject: Use ctime, not mtime, for identifying changes
Diffstat (limited to 'ranger')
-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