[Ssh-sftp-perl-users] Help required with "auto exit" using SSH
Brought to you by:
dbrobins
|
From: Srinivasan R. <sri...@ya...> - 2004-10-24 03:07:10
|
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.
Thank you for help in advance,
Srinivasan
Here is the code I use to connect to a remote server, put a test file and close the program:
my $TestFile = "abc.txt";
$TargetPathAndFile = "/home/aUser";
my %keyValuePair = ("user", "aUSER", password","APassword","debug","1");
my $sftp = Net::SFTP->new("$myServer", keyValuePair);
if (! $sftp)
{
my $ErrorMsg = "Failed connecting to $host: $!";
print ($ErrorMsg);
exit (-1);
}
Trace ("Connected to "$myServer using Secure FTP Protocol...");
$sftp->put($TestFile, $TargetPathAndFile);
exit(0);
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today! |