Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendin file with SFTP

Status
Not open for further replies.

scarcorp

Programmer
Aug 14, 2007
2
AU
Hi,

I'm still relatively new at programing TCL.

I am trying to send a file using SFTP (I have it working well with FTP), this is the code I use:

set pipe [open "|sftp $server" w+]
fconfigure $pipe -blocking 0 -buffering line
puts $pipe "$pass"
puts $pipe "put $localfile $remotefile"
puts $pipe "exit"
close $pipe
return 1

It sends the "user@host password's" input to the console and just stops processing without sending the file. It works quite well using FTP but has me stumped with SFTP.

Any suggestions?

Thank you,
Johnny
 
Not a solution but did you tried to print the pipe handle (puts $pipe) to see if all is as expected?

HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top