Lines Matching full:path

29     def normpath(self, path):  argument
30 if path in self.normpathcache:
31 return self.normpathcache[path]
32 newpath = os.path.normpath(path)
33 self.normpathcache[path] = newpath
36 def _callstat(self, path): argument
37 if path in self.statcache:
38 return self.statcache[path]
40 st = os.stat(path)
41 self.statcache[path] = st
44 self.statcache[path] = False
51 def callstat(self, path): argument
52 path = self.normpath(path)
53 self.calllstat(path)
54 return self.statcache[path]
56 def calllstat(self, path): argument
57 path = self.normpath(path)
58 if path in self.lstatcache:
59 return self.lstatcache[path]
60 #bb.error("LStatpath:" + path)
62 lst = os.lstat(path)
63 self.lstatcache[path] = lst
65 self.statcache[path] = lst
67 self._callstat(path)
70 self.lstatcache[path] = False
71 self.statcache[path] = False
75 # for the same path ono systems that support symlinks
76 def isfile(self, path): argument
77 """Test whether a path is a regular file"""
78 st = self.callstat(path)
83 # Is a path a directory?
85 # can be true for the same path on systems that support symlinks
93 def islink(self, path): argument
94 """Test whether a path is a symbolic link"""
95 st = self.calllstat(path)
100 # Does a path exist?
102 def exists(self, path): argument
103 """Test whether a path exists. Returns False for broken symbolic links"""
104 if self.callstat(path):
108 def lexists(self, path): argument
109 """Test whether a path exists. Returns True for broken symbolic links"""
110 if self.calllstat(path):
116 def stat(self, path): argument
117 return self.callstat(path)
121 def lstat(self, path): argument
122 return self.calllstat(path)
125 # Matches os.walk, not os.path.walk()
128 # get a list of the files the directory contains. os.path.walk
141 if self.isdir(os.path.join(top, name)):
149 new_path = os.path.join(top, name)
158 return (file + os.path.sep).startswith(root)
161 """Calculates real path of symlink 'start' + 'rel_path' below
165 for d in rel_path.split(os.path.sep):
169 if d == os.path.pardir: # '..'
172 start = os.path.dirname(start)
177 (start, have_dir) = self.__realpath(os.path.join(start, d),
190 target = os.path.normpath(os.readlink(file))
192 if not os.path.isabs(target):
193 tdir = os.path.dirname(file)
208 """ Returns the canonical path of 'file' with assuming a
210 preceding path components of 'file' will be resolved first;
212 no symlink in the path. When 'assume_dir' is not set, missing
213 path components will raise an ENOENT error"""
215 root = os.path.normpath(root)
216 file = os.path.normpath(file)
218 if not root.endswith(os.path.sep):
220 root = root + os.path.sep