Genghis_Khan has asked for the wisdom of the Perl Monks concerning the following question:

Have curious question: I am ftp'ing from a Unix machine to a Windoze machine on our network. I am able to manually delete files on the Windoze machine by just typing ftp my.host.machine.ip along with the credentials from the unix shell. Then, I issue a 'DELE' <filename> and voila, it works! However, when I am using the Net::FTP module, and logging into the same machine with the same credentials, I can do just about everything that I want to do except that calling $ftp->delete(<filename>) does not delete the file on the host machine even when the return code is 1. Any ideas?????

Replies are listed 'Best First'.
Re: Net::FTP and $ftp->delete
by Mr. Muskrat (Canon) on Aug 06, 2003 at 21:39 UTC

    Something like this should help out:
    $ftp->delete($filename) or die $ftp->message();

    message() is inherited from Net::Cmd and it returns the text message returned from the last command.

      Mr. Muskrat: I tried that as well. It gives nothing back. Thanks Genghis Khan
Re: Net::FTP and $ftp->delete
by princepawn (Parson) on Aug 06, 2003 at 22:12 UTC
    Also in your constructor for Net::FTP you could use the Debug => option and look at the transcript.

    Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

      I do use the Debug => 1 in the constructor
        So, what does the transcript say?

        Makeshifts last the longest.