Error in delete file using NET:FTP module
am 11.02.2006 00:31:45 von shao
I am very new to perl. I use following script to delete a file on ftp
server.
$ftpobj -> delete($fileName) or $newerr=1;
print "cannot delete $fileName:$!\n" if $newerr;
However, it works on windows, but does not work on linux. On linux, $!
even returns empty string, so i have no way to find out what's wrong.
the file just cannot be deleted.
Does anyone know what's going on?
thanks a bunch!
Re: Error in delete file using NET:FTP module
am 11.02.2006 00:53:02 von shao
after researching net ftp module, i used -> message to get latest error
message and it says 'DELE ': Invalid number of parameters.
But I do provide the filename correctly. And I have also tried to run
delete command by manually ftp to server from linux terminal and file
can be deleted just fine. What went wrong here.
Thanks again,
Re: Error in delete file using NET:FTP module
am 11.02.2006 01:53:55 von Sisyphus
"shellyshao" wrote in message
news:1139615582.449123.189990@g47g2000cwa.googlegroups.com.. .
> after researching net ftp module, i used -> message to get latest error
> message and it says 'DELE ': Invalid number of parameters.
>
I don't know why you're getting this problem. Is there something unusual in
the filename that could lead to the server perceiving it as more than one
argument ?
Could you post (copy'n'paste) a complete (minimal) script that demonstrates
the problem. (Change any 'username' and 'password' info ... and hostname,
too, if you want - but leave everything else as it is.)
Also, turn on debugging when you create $ftpobj:
my $ftpobj = Net::FTP->new("some.host.name", Debug => 1)
I don't know if that will provide anything more useful than '$ftpobj ->
message', but it might help.
Cheers,
Rob
Re: Error in delete file using NET:FTP module
am 15.02.2006 00:18:31 von shao
thanks for the hint, I found out what's wrong here. After applying
double quote around $fileName, this runs nicely in linux.