summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-23 03:11:20 +0200
committerhut <hut@lavabit.com>2010-05-23 03:11:20 +0200
commitca44b07676fd0ffaf9be9e2ad6c211f84973cde4 (patch)
tree325e3e35edf1291886c339541b8740847cb87670
parent46693c4b84e522d3c26740a7642188fbb628a2b8 (diff)
downloadranger-ca44b07676fd0ffaf9be9e2ad6c211f84973cde4.tar.gz
fsobject.fsobject: removed access() call in load function
-rw-r--r--ranger/fsobject/directory.py2
-rw-r--r--ranger/fsobject/fsobject.py13
2 files changed, 5 insertions, 10 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 50564835..1cef8ed8 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -165,7 +165,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware):
 		self.load_if_outdated()
 
 		try:
-			if self.exists and self.runnable:
+			if self.runnable:
 				yield
 				self.mount_path = mount_path(self.path)
 
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index f933cfc3..9ec7b2cb 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -48,7 +48,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 	is_socket,
 
 	accessible,
-	exists,
+	exists,       # "exists" currently means "link_target_exists"
 	loaded,
 	marked,
 	runnable,
@@ -174,14 +174,16 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			if is_link:
 				new_stat = self.preload[0]
 			self.preload = None
+			self.exists = new_stat and True or False
 		else:
 			try:
 				new_stat = lstat(path)
 				is_link = (new_stat.st_mode & 0o120000) == 0o120000
 				if is_link:
 					new_stat = stat(path)
+				self.exists = True
 			except:
-				pass
+				self.exists = False
 
 		# Set some attributes
 		if new_stat:
@@ -191,13 +193,6 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			self.is_fifo = (mode & 0o010000) == 0o010000
 			self.is_link = is_link
 			self.is_socket = (mode & 0o140000) == 0o140000
-			if access(path, 0):
-				self.exists = True
-				if self.is_directory:
-					self.runnable = (mode & 0o0100) == 0o0100
-			else:
-				self.exists = False
-				self.runnable = False
 		else:
 			self.accessible = False