'Find and the closest matching posting list container file'

@classmethod
def _GetFilenameAndSig(cls, config, sig):

    sig = sig[:cls.MAX_HASH_LEN]
    while (len(sig) > 0):
        fn = cls._SaveFile(config, sig)
        try:
            if os.path.exists(fn):
                return (fn, sig)
        except (IOError, OSError):
            pass
        if (len(sig) > 1):
            sig = sig[:(-1)]
        else:
            return (fn, sig)
    return (None, None)
