Lines Matching refs:file
151 def __is_path_below(self, file, root): argument
152 return (file + os.path.sep).startswith(root)
178 def __realpath(self, file, root, loop_cnt, assume_dir): argument
179 while self.islink(file) and len(file) >= len(root):
181 raise OSError(errno.ELOOP, file)
184 target = os.path.normpath(os.readlink(file))
187 tdir = os.path.dirname(file)
192 file = self.__realpath_rel(tdir, target, root, loop_cnt, assume_dir)
195 is_dir = self.isdir(file)
199 return (file, is_dir)
201 def realpath(self, file, root, use_physdir = True, loop_cnt = 100, assume_dir = False): argument
210 file = os.path.normpath(file)
216 if not self.__is_path_below(file, root):
217 raise OSError(errno.EINVAL, "file '%s' is not below root" % file)
221 file = self.__realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
223 file = self.__realpath(file, root, loop_cnt, assume_dir)[0]
231 (file, e.strerror))
235 return file