def GetAttachLink(self, session):
        _hash = Util.HashGen(self.path(), "python nb")
        filename = ''
        for i in range(2):
            filename += "%0x" % struct.unpack('=I', _hash[i*4:(i+1)*4])
        link = "http://%s/bbscon.php?b=xattach&f=%s" % (session.GetMirror(Config.Config.GetInt('ATTACHMENT_PORT', 80)), filename)

        linkfile = "%s/boards/xattach/%s" % (Config.BBS_ROOT, filename)
        target = "../../%s" % self.path()
        try:
            os.symlink(target, linkfile)
        except:
            # we should not omit other errors
            # anyway...
            pass
        return link
dataset/ETHPy150Open HenryHu/pybbs/digest.py/DigestItem.GetAttachLink/original