"use strict";var util=require("./util"),ptp=require("../.."),fs=require("fs"),onConnected,onObjectGotten;onObjectGotten=function(e,t){fs.writeFile(t,e.buffer,function(e){e?console.log("Failed: ",e):console.log("Saved to "+t)})},onConnected=function(e,t){console.log("Getting object "+e+"..."),ptp.getObject({objectHandle:e,onSuccess:function(e){onObjectGotten(e.dataPacket,t),ptp.disconnect()},onFailure:function(){console.error("Failed"),ptp.disconnect()}})},module.exports=function(e,t,n){require("./connect")({host:e,onConnected:onConnected.bind(this,t,n)})};