From f05a2eda194142de77a62acb12fecc2ec6386c48 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 6 Nov 2010 16:44:51 +0100 Subject: fsobject.fsobject: Use ctime, not mtime, for identifying changes --- ranger/fsobject/fsobject.py | 7 ++++--- ranger/gui/widgets/statusbar.py | 12 ++++++------ 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 -- cgit 1.4.1-2-gfad0