I'm writing a module that uses FTPLib to fetch files. I want to find a way to pass a value(in addition to the block) to the callback. Essentially, my callback is
def handleDownload(block, fileToWrite):
fileToWrite.write(block)
And I need to call
ftp.retrbinary('RETR somefile', handleDownload)
And have it pass a file handle. Is there a way to do this?