Posted on 2005-02-10 09:43:16-08 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 2005-02-11 23:32:17-08 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 2005-02-14 04:25:15-08 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.
Direct Responses: Write a response
Posted on 2005-02-14 04:25:29-08 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 2005-06-10 08:50:29-07 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 2005-06-13 07:41:23-07 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());
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.