How to use the fcp.node.base64encode function in fcp

To help you get started, we’ve selected a few fcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freenet / pyFreenet / freedisk.py View on Github external
def doFsCommand(self, cmd):
        """
        Executes a command via base64-encoded file
        """
        cmdBase64 = fcp.node.base64encode(cmd)
        if len(cmdBase64) > 254:
            raise Exception("Command too long")
    
        path = self.conf.mountpoint + "/cmds/" + cmdBase64
        return file(path).read()