summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/fsobject/fsobject.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 28e32055..3a2f6012 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -232,9 +232,6 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 
 		# Set some attributes
 		if self.stat:
-			if self.is_link:
-				self.realpath = realpath(self.path)
-				self.readlink = os.readlink(self.path)
 			mode = self.stat.st_mode
 			self.is_device = bool(S_ISCHR(mode) or S_ISBLK(mode))
 			self.is_socket = bool(S_ISSOCK(mode))
@@ -247,6 +244,9 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			else:
 				self.exists = False
 				self.runnable = False
+			if self.is_link and self.exists:
+				self.realpath = realpath(self.path)
+				self.readlink = os.readlink(self.path)
 		else:
 			self.accessible = False