Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Issue: SshCommand should have an InputStream [1422]

$
0
0
In Python using paramiko, I would write code like:<br> cli = SSHClient()<br> cli.connect(....)<br> myIn,myOut.myErr = cli.exec_command(r&quot;&quot;&quot;bash -c 'x=`mktemp --tmpdir conf-XXXXXXXX.xml &amp;&amp; cat - &gt; $x &amp;&amp; echo $x'&quot;&quot;&quot;)<br> myIn.write(ALotOfStuff)<br> myIn.flush()<br> myIn.channel.shutdown_write()<br> confFile = myOut.read()[:-1],<br>which would net me a temporary file that I'd written stuff to, and its name. Using the ShellStream class doesn't quite work - the standard error is interspersed, there's no return codes, and for some reason shell control codes get interspersed in the data written to the file.<br><br>I figure the most obvious solution is to add an InputStream property to SshCommand. I'm having a go at it @ github.com/mvanderkolff/renci.sshnet-mvdk
Comments: ** Comment from web user: olegkap **

Hi,

I cant see a reason where you need to use an InputStream as command text, since command text needs to be sent as a whole at once so it needs to be read, so before you execute a command you can read it all as a string and then pass this string to command to execute.


Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>