Operating System - HP-UX
1825161 Members
2341 Online
109679 Solutions
New Discussion юеВ

ftp->quit fails with error Bad file number for some servers

 
Debangana Ghoshal
Occasional Advisor

ftp->quit fails with error Bad file number for some servers

Hi

I have written a ftp script in perl.It seems to work fine but for some servers it throws an error "Bad file number" while trying to close the connection.What can be the reason for this?How should I resolve it?

Thanks
Debangana
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: ftp->quit fails with error Bad file number for some servers

Shalom,

It would be helpful to actually see the script.

Hard to diagnose without.

Please post. Change the security information.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Debangana Ghoshal
Occasional Advisor

Re: ftp->quit fails with error Bad file number for some servers

Thanks for the reply.Following is the ftp section from my code:

if (!$ftp->get($ftp_FileList, $output_file_path."$ftp_FileList"))
{
$logger->error("Status: Can't Get File $ftp_FileList \n");
unlink($output_file_path.$ftp_FileList);
next;
}else
{$logger->info("Update the cache file");
print CASHE_WRITE "$ftp_FileList\n";
$logger->info("Updated the cache file");
}
$ftp->quit or die $logger->error("Couldn't quit ftp session\n"),exit;
$logger->info("---------------------------Quiting FTP----------------------------\n");
close CASHE_WRITE || $logger->error("Can't close $cacheFile opened in write mode\n");

Thanks
Debangana
Debangana Ghoshal
Occasional Advisor

Re: ftp->quit fails with error Bad file number for some servers

Hi

I have tried enabling the debug mode and following is what the code logs:
Net::FTP=GLOB(0x40b6b868)<<< 226 Transfer complete.
Net::FTP=GLOB(0x40b6b868)>>> QUIT
Net::FTP=GLOB(0x40b6b868)<<< 221-You have transferred 131595 bytes in 1 files.
Net::FTP: Unexpected EOF on command channel

Please suggest on how to resolve this problem.

Thanks
Debangana