Home > Archive > PERL Modules > February 2006 > Error in delete file using NET:FTP module
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Error in delete file using NET:FTP module
|
|
| shellyshao 2006-02-10, 6:56 pm |
| 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!
| |
| shellyshao 2006-02-10, 6:56 pm |
| 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,
| |
| Sisyphus 2006-02-10, 9:55 pm |
|
"shellyshao" <shellyshao@gmail.com> 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
| |
| shellyshao 2006-02-14, 6:56 pm |
| thanks for the hint, I found out what's wrong here. After applying
double quote around $fileName, this runs nicely in linux.
|
|
|
|
|