[Ssh-sftp-perl-users] RE: Ssh-sftp-perl-users digest, Vol 1 #44 - 2 msgs
Brought to you by:
dbrobins
|
From: Jutu S. S. (Cognizant) <JSr...@ch...> - 2004-10-25 05:25:21
|
Hi,
How to close the SFTP file handle?
sftp->close(); #It is not working. Is thery any other way to handle=
this?
regards
Srinivas
-----Original Message-----
From: ssh...@li...
[mailto:ssh...@li...]On Behalf Of
ssh...@li...
Sent: Sunday, October 24, 2004 9:05 AM
To: ssh...@li...
Subject: Ssh-sftp-perl-users digest, Vol 1 #44 - 2 msgs
Send Ssh-sftp-perl-users mailing list submissions to
ssh...@li...
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users
or, via email, send a message with subject or body 'help' to
ssh...@li...
You can reach the person managing the list at
ssh...@li...
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Ssh-sftp-perl-users digest..."
Today's Topics:
1. Net::SFTP methods that return handles (Steve Sapovits)
2. Help required with "auto exit" using SSH (Srinivasan Ramaswami)
--__--__--
Message: 1
Date: Sat, 23 Oct 2004 12:13:12 -0400
From: Steve Sapovits <sap...@gs...>
Reply-To: sap...@gs...
Organization: GSI Commerce Inc.
To: ssh...@li...
Subject: [Ssh-sftp-perl-users] Net::SFTP methods that return handles
I have ssh and Net::SFTP working in an SSH2 environment (mostly
Solaris as a platform). It all works fine except for the methods
that return handles. These all return undef with no error or
warning messages. I added some debug to the source and can see
that each one gets an ID but that the get_handle() call on that
ID returns undef. Specifically, I've been trying to get the
do_open() and do_opendir() methods to work.
Any ideas?
Thanks in advance ...
--=0D
Steve Sapovits GSI Commerce, Inc. http://www.gsicommerce.com
Email: sap...@gs...
--__--__--
Message: 2
Date: Sat, 23 Oct 2004 20:07:01 -0700 (PDT)
From: Srinivasan Ramaswami <sri...@ya...>
To: ssh...@li...
Subject: [Ssh-sftp-perl-users] Help required with "auto exit" using SSH
--0-1699601947-1098587221=3D:57638
Content-Type: text/plain; charset=3Dus-ascii
On Solaris 2.8 I am using the following code to make a Secure FTP=
connection with key encryption. When the perl program is done, I find a=
core file on the target FTP server this program did a FTP Connection to.=
When I did a "file core" command on the core file, it indicates the perl=
program did an auto exit which caused this core dump. Since SFTP interface=
does not have a $FTP_HANDLE->close call like in the FTP module. Has anyone=
experienced this problem, how can I provide a normal exit.
=0D
Thank you for help in advance,
Srinivasan
=0D
=0D
Here is the code I use to connect to a remote server, put a test file and=
close the program:
=0D
my $TestFile =3D "abc.txt";
$TargetPathAndFile =3D "/home/aUser";
my %keyValuePair =3D ("user", "aUSER", password","APassword","debug","1");
my $sftp =3D Net::SFTP->new("$myServer", keyValuePair);
if (! $sftp)
{
my $ErrorMsg =3D "Failed connecting to $host: $!";
print ($ErrorMsg);
exit (-1);
}
Trace ("Connected to "$myServer using Secure FTP Protocol...");
$sftp->put($TestFile, $TargetPathAndFile);
exit(0);
=0D
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
--0-1699601947-1098587221=3D:57638
Content-Type: text/html; charset=3Dus-ascii
<DIV>On Solaris 2.8 I am using the following code to make a Secure FTP=
connection with key encryption. When the perl program is done, I find a=
core file on the target FTP server this program did a FTP Connection=
to. When I did a "file core" command on the core file, it indicates the=
perl program did an auto exit which caused this core dump. Since SFTP=
interface does not have a $FTP_HANDLE->close call like in the FTP=
module. Has anyone experienced this problem, how can I provide a normal=
exit.</DIV>
<DIV> </DIV>
<DIV>Thank you for help in advance,</DIV>
<DIV>Srinivasan</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Here is the code I use to connect to a remote server, put a test file=
and close the program:</DIV>
<DIV> </DIV>
<DIV>my $TestFile =3D "abc.txt";</DIV>
<DIV>$TargetPathAndFile =3D "/home/aUser";</DIV>
<DIV>my %keyValuePair =3D ("user", "aUSER",=
password","APassword","debug","1");<BR>my $sftp =3D=
Net::SFTP->new("$myServer", keyValuePair);<BR> if (!=
$sftp)<BR> {<BR>  =
; my $ErrorMsg =3D "Failed connecting to $host:=
$!";<BR> print=
($ErrorMsg);<BR> exit=
(-1);</DIV>
<DIV>}<BR>Trace ("Connected to "$myServer using Secure FTP=
Protocol...");<BR>$sftp->put($TestFile, $TargetPathAndFile);</DIV>
<DIV>exit(0);</DIV><p>
<hr size=3D1>Do you Yahoo!?<br><a
href=3D"http://vote.yahoo.com">vote.yahoo.com</a> - Register online to vote=
today!
--0-1699601947-1098587221=3D:57638--
--__--__--
_______________________________________________
Ssh-sftp-perl-users mailing list
Ssh...@li...
https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users
End of Ssh-sftp-perl-users Digest
This e-mail and any files transmitted with it are for the sole use of the=
intended recipient(s) and may contain confidential and privileged=
information.
If you are not the intended recipient, please contact the sender by reply=
e-mail and destroy all copies of the original message.=0D
Any unauthorized review, use, disclosure, dissemination, forwarding,=
printing or copying of this email or any action taken in reliance on this=
e-mail is strictly=0D
prohibited and may be unlawful.
Visit us at http://www.cognizant.com
|