I am using Python 3.8.10 and fabric 2.7.0.
I have a Connection
to a remote host. I am executing a command such as follows:
resObj = connection.run("cat /usr/bin/binaryFile")
So in theory the bytes of /usr/bin/binaryFile
are getting pumped into stdout
but I can not figure out what wizardry is required to get them out of resObj.stdout
and written into a file locally that would have a matching checksum (as in, get all the bytes out of stdout). For starters, len(resObj.stdout) !== binaryFile.size
. Visually glancing at what is present in resObj.stdout
and comparing to what is in /usr/bin/binaryFile
via hexdump
or similar makes them seem about similar, but something is going wrong.
May the record show, I am aware that this particular example would be better accomplished with...
connection.get('/usr/bin/binaryFile')
The point though is that I'd like to be able to get arbitrary binary data out of stdout.
Any help would be greatly appreciated!!!