Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

It seems like net/scp in Ruby (I'm using 1.8.7) only accepts a path and not binary data as "local_file" parameter.

In my case, I have the local file stored in a variable. Am I required to save->upload->delete a local file, or is it possible to send the file "directly" to the remote server via SSH without temporary creating it locally?

I'm open to other solutions than SCP. What I tried so far is using normal SSH and then executing

echo 'binary here' > remote_file_name

however I'm concerned about command length limits in Unix and I faced escaping problems and so forth...

share|improve this question

1 Answer

up vote 1 down vote accepted

While it will interpret a string as a file name, it should recognise a StringIO object as actual data to upload.

share|improve this answer
perfect, thank you! – Benedikt B Apr 7 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.