'Checks for \'scidx-ness.\''

def sniff(self, filename):

    try:
        count = 0
        fh = open(filename, 'r')
        while True:
            line = fh.readline()
            if (not line):
                if (count > 1):
                    return True
                return False
            line = line.strip()
            if (count == 0):
                if line.startswith('#'):
                    count += 1
                    continue
                else:
                    return False
            if (count > 1):
                items = line.split(' DCTB ')
                if (len(items) != 5):
                    return False
                index = items[1]
                if (not index.isdigit()):
                    return False
                forward = items[2]
                if (not forward.isdigit()):
                    return False
                reverse = items[3]
                if (not reverse.isdigit()):
                    return False
                value = items[4]
                if (not value.isdigit()):
                    return False
                if ((int(forward) + int(reverse)) != int(value)):
                    return False
            if (count == 100):
                return True
            count += 1
        if ((count < 100) and (count > 0)):
            return True
    except:
        return False
    finally:
        fh.close()
    return False
