summary refs log tree commit diff stats
path: root/ranger/fsobject/fsobject.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-24 16:57:30 +0100
committerhut <hut@lavabit.com>2009-12-24 16:57:30 +0100
commitec5dfcb1cb0f549fea3ecf7b0505f02e197887b2 (patch)
treede91f673aed439c2bf509623a382c7e31bd0cce8 /ranger/fsobject/fsobject.py
parent2c9a912e089d8757a3cf5c8493d7ecc9147314d7 (diff)
downloadranger-ec5dfcb1cb0f549fea3ecf7b0505f02e197887b2.tar.gz
random fixes
Diffstat (limited to 'ranger/fsobject/fsobject.py')
-rw-r--r--ranger/fsobject/fsobject.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index b1354da1..1864a7fc 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -101,7 +101,8 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 		self.marked = bool(boolean)
 
 	def load(self):
-		"""reads useful information about the filesystem-object from the
+		"""
+		reads useful information about the filesystem-object from the
 		filesystem and caches it for later use
 		"""
 		import os
@@ -195,17 +196,21 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 		return False
 
 	def load_if_outdated(self):
-		"""calls load() if the currently cached information is outdated
+		"""
+		Calls load() if the currently cached information is outdated
 		or nonexistant.
 		"""
 		if self.load_once(): return True
 
 		import os
 		try:
-			real_mtime = os.stat(self.path).st_mtime
+			real_mtime = os.lstat(self.path).st_mtime
 		except OSError:
-			return False
-		cached_mtime = self.stat.st_mtime
+			real_mtime = None
+		if self.stat:
+			cached_mtime = self.stat.st_mtime
+		else:
+			cached_mtime = 0
 
 		if real_mtime != cached_mtime:
 			self.load()