equal
deleted
inserted
replaced
309 def isfile(self, path=None): |
309 def isfile(self, path=None): |
310 return os.path.isfile(self.join(path)) |
310 return os.path.isfile(self.join(path)) |
311 |
311 |
312 def islink(self, path=None): |
312 def islink(self, path=None): |
313 return os.path.islink(self.join(path)) |
313 return os.path.islink(self.join(path)) |
|
314 |
|
315 def isfileorlink(self, path=None): |
|
316 '''return whether path is a regular file or a symlink |
|
317 |
|
318 Unlike isfile, this doesn't follow symlinks.''' |
|
319 try: |
|
320 st = self.lstat(path) |
|
321 except OSError: |
|
322 return False |
|
323 mode = st.st_mode |
|
324 return stat.S_ISREG(mode) or stat.S_ISLNK(mode) |
314 |
325 |
315 def reljoin(self, *paths): |
326 def reljoin(self, *paths): |
316 """join various elements of a path together (as os.path.join would do) |
327 """join various elements of a path together (as os.path.join would do) |
317 |
328 |
318 The vfs base is not injected so that path stay relative. This exists |
329 The vfs base is not injected so that path stay relative. This exists |