Thread

Posted on Thu Feb 10 11:43:16 2005 by annabond
No command to close the sftp connection
I am moving my code from "ftp" to "sftp".. I have faced umpteen number of problems because of that. The biggest problem is to find a sftp command for the ftp cmds in my code. Using the ftp module i can call the "quit" command (from the script) to close the connection. I dont seem to find the similar cmd in the sftp module for closing the connection. It would be great if someone could point out how to close the sftp connection.
Direct Responses: 98 | Write a response
Posted on Sat Feb 12 01:32:17 2005 by dbrobins in response to 79
Re: No command to close the sftp connection
Just let the object go out of scope, or explicitly undef it.
Direct Responses: 107 | 108 | Write a response
Posted on Mon Feb 14 06:25:15 2005 by annabond in response to 98
Re: No command to close the sftp connection
Thanks robins.. it is working fine ;) I have used undefed the object. Pretty elegant solution though.
Write a response
Posted on Mon Feb 14 06:25:29 2005 by annabond in response to 98
Re: No command to close the sftp connection
Thanks robins.. it is working fine ;) I have undefed the object. Pretty elegant solution though.
Direct Responses: 607 | Write a response
Posted on Fri Jun 10 11:50:29 2005 by thomas in response to 108
Re: No command to close the sftp connection
Close still doesn't work. I tried to "undef" the handle but the connection is still hold. Any idea what is wrong ?? Thanks for any Help, Thomas
Direct Responses: 612 | Write a response
Posted on Mon Jun 13 10:41:23 2005 by thomas in response to 607
Re: No command to close the sftp connection
Found a solution, you have to close the socket:
close($sftph->{ssh}->sock());
Write a response