Click here to get back home

Error in delete file using NET:FTP module

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Error in delete file using NET:FTP module shellyshao 02-10-2006
Posted by shellyshao on February 10, 2006, 6:31 pm
Please log in for more thread options


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!


Posted by shellyshao on February 10, 2006, 6:53 pm
Please log in for more thread options


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,


Posted by Sisyphus on February 10, 2006, 7:53 pm
Please log in for more thread options



> 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



Posted by shellyshao on February 14, 2006, 6:18 pm
Please log in for more thread options


thanks for the hint, I found out what's wrong here. After applying
double quote around $fileName, this runs nicely in linux.


Similar ThreadsPosted
Net::FTP error when local file does not exist September 23, 2004, 7:55 am
FTP problem with delete June 14, 2005, 12:22 pm
XML::XPath delete function November 26, 2007, 3:35 pm
Script to delete email from an account February 1, 2006, 11:07 am
Remote.pm (File::Remote) error handling question January 29, 2007, 12:57 pm
Net::POP3 quit failing, cannot delete some spam email August 31, 2004, 10:13 am
Error in Spreadsheet module August 9, 2007, 3:27 am
Perl-Tk module - relocation error December 2, 2004, 4:12 pm
Error in perl module "bignum"... May 14, 2006, 4:31 pm
Looking for a file transfer module NOT ftp May 9, 2006, 11:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap