my ( $addr, $usr, $pwd, $ascii, $active, $timeout ) = @_;
my $ftp;
# Set up new FTP with active mode and user-specified timeout...
if ( $active and $timeout )
{
$ftp = Net::FTP -> new ( $addr, Passive => 0, Timeout => $timeout )
or die "Failed to connect to FTP (w/
我在Linux上运行了一个FTP脚本,它正在失败。下面是脚本:
/usr/bin/ftp -v -i -n my.ftp.server << cmd
user ftpuser password
binary
ls
<some other commands here>
quit cmd
它返回一个错误:
421 Service not available, remote server has closed connection
Not connected.
奇怪的是,如果我在命令行/usr/bin/ftp my.ftp.server中输入了这个命令,它会询问用户名