[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trouble obtaining binary files from server with SCP
[Thread Prev] | [Thread Next]
- Subject: Trouble obtaining binary files from server with SCP
- From: Искрен Хаджинедев <iskrenh@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 20 Feb 2012 04:59:18 +0200
- To: libssh@xxxxxxxxxx
Greetings,I have some trouble transfering binary files with the SCP Subsystem of libssh. I've attached the test program I use for clearance, because my English is not that great and someone could misunderstand me. If I try to obtain a text file it arrives fine, but if I try to scp a binary file (/bin/grep and /bin/cp in this case), they arrive broken. I tried to use <stdio.h> with FILE* and <fstream> with ofstream file.open("filename") and file.write(buffer,size), but results are the same. I've left the filenames the way I use them in main() and here's an md5sum of the results:
--- 548c9b7165161ff7eeed88c7473bf637 cp b320d190fc6b5a377010bbd58d781d85 /bin/cp a89c9916945a1a2a7aa92648df1591ba grep 6c7c644703d8669aca747a0268b584b6 /bin/grep 0b14bf24063422f7befb1f019abd69a5 rc.conf 0b14bf24063422f7befb1f019abd69a5 /etc/rc.conf 3d383a4387cc453593d6aa21fd3bc1f5 smb.conf 3d383a4387cc453593d6aa21fd3bc1f5 /etc/samba/smb.conf d6a9c4997493c5cca344ee838c423811 hosts d6a9c4997493c5cca344ee838c423811 /etc/hosts --- Thank you for your time and help.
Attachment:
libssh_test.tar.gz
Description: GNU Zip compressed data
Archive administrator: postmaster@lists.cynapses.org