def _stat_filename_or_fileobj(filename):
    closed = fileobj_closed(filename)
    name = fileobj_name(filename) or ''

    try:
        loc = filename.tell()
    except __HOLE__:
        loc = 0

    noexist_or_empty = ((name and
                         (not os.path.exists(name) or
                          (os.path.getsize(name) == 0)))
                         or (not name and loc == 0))

    return name, closed, noexist_or_empty
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/convenience.py/_stat_filename_or_fileobj