Check is file or dir

How to check is path a file or directory?
I mean in python I can do this

def is_file_or_dir(path):
    try:
        os.listdir(path)
        return 'dir'
    except:
        return 'file'

Can I do something like this in app inventor?

Use the file component

image

I don't have access to file, I need to do this using saf...

Why, show your blocks.