def get_type(interp, this): filename = this.file_name if not filename: return interp.space.w_False try: return _filetype(interp.space, filename) except OSError: raise PHPException(k_RuntimeException.call_args( interp, [interp.space.wrap( "SplFileInfo::getType(): stat failed for %s" % filename)]))
def di_get_type(interp, this): if this.w_dir_res.index < this.w_dir_res.no_of_items: item = _di_pathname(this) else: item = this.path return _filetype(interp.space, item)