def isfile(self): try: with self('r'): return stat.S_ISREG(self.stat().st_mode) except IOError: return False