def file_get( blockchain_id, hostname, sender_blockchain_id, data_name, output_path, passphrase=None, config_path=CONFIG_PATH, wallet_keys=None ):
config_dir = os.path.dirname(config_path)<EOL>client_config_path = os.path.join(config_dir, blockstack_client.CONFIG_FILENAME )<EOL>proxy = blockstack_client.get_default_proxy( config_path=client_config_path )<EOL>fq_data_name = file_fq_data_name( data_name ) <EOL>res = blockstack_client.data_get( blockstack_client.make_mutable_data_url( sender_blockchain_id, fq_data_name, None ), wallet_keys=wallet_keys, proxy=proxy )<EOL>if '<STR_LIT:error>' in res:<EOL><INDENT>log.error("<STR_LIT>" % (fq_data_name, res['<STR_LIT:error>']))<EOL>return {'<STR_LIT:error>': '<STR_LIT>'}<EOL><DEDENT>fd, path = tempfile.mkstemp( prefix="<STR_LIT>" )<EOL>f = os.fdopen(fd, "<STR_LIT:w>")<EOL>f.write( res['<STR_LIT:data>']['<STR_LIT>'] )<EOL>f.flush()<EOL>os.fsync(f.fileno())<EOL>f.close()<EOL>sender_key_id = res['<STR_LIT:data>']['<STR_LIT>']<EOL>res = file_decrypt( blockchain_id, hostname, sender_blockchain_id, sender_key_id, path, output_path, passphrase=passphrase, config_path=config_path, wallet_keys=wallet_keys )<EOL>os.unlink( path )<EOL>if '<STR_LIT:error>' in res:<EOL><INDENT>log.error("<STR_LIT>" % res['<STR_LIT:error>'])<EOL>return {'<STR_LIT:error>': '<STR_LIT>'}<EOL><DEDENT>else:<EOL><INDENT>return res<EOL><DEDENT>
Get a file from a known sender.
Store it to output_path
Return {'status': True} on success
Return {'error': error} on failure