PERL:无法在FTP模式下执行cwd
我无法在FTP模式下将cd刻录到远程计算机上的路径。请告知PERL:无法在FTP模式下执行cwd,perl,ftp,cd,cwd,Perl,Ftp,Cd,Cwd,我无法在FTP模式下将cd刻录到远程计算机上的路径。请告知 if (! $sftp->cwd($tgt)) { $error = $sftp->error; #print ("Unable to cd to $tgt: $error\n"); print ("$error\n"); logmsg("Unable to cd to $tgt: $error\n"); mailmsg("Unable to cd to $tgt: $error\n"
if (! $sftp->cwd($tgt)) {
$error = $sftp->error;
#print ("Unable to cd to $tgt: $error\n");
print ("$error\n");
logmsg("Unable to cd to $tgt: $error\n");
mailmsg("Unable to cd to $tgt: $error\n");
myExit();
} else {
print ("Able to cd to $tgt: \n");
logmsg("Able to cd to $tgt: \n");
}
我得到的错误仅为0。我在网上查过,0表示语法错误,但我个人不这么认为。您使用的是哪个SFTP库?
$tgt
的值是多少?我的$sftp=Net::FTP->new($server,%args);什么是$ftp->code()
和$ftp->message()
?如果使用ftp,请不要命名变量sftp
。这很混乱。错误
是一种方法。您应该查看消息的返回值
您使用的是哪个SFTP库?$tgt
的值是多少?我的$sftp=Net::FTP->new($server,%args);什么是$ftp->code()
和$ftp->message()
?如果使用ftp,请不要命名变量sftp
。这很混乱。错误
是一种方法。您应该查看消息的返回值