1826578 Members
3722 Online
109695 Solutions
New Discussion

FTP question

 
cam9269
Regular Advisor

FTP question

Hi Gurus,

I have this task which needs to do FTP's from HPUX > Windows and HPUX > HPUX servers.

I've found Clay's ftpput.pl and ftpget.pl, all's doing well with these scripts. There's just one requirement which I can't get the scripts to produce - and that is to delete multiple remote files without performing transfers

On an ordinary FTP command it would look like this:
-----------------------------------
user $LOGNAME $PASSWD
bin
cd $DIRECTORY
mdele * <<<<--- This bit
bye
-----------------------------------

TIA!

5 REPLIES 5
Suraj K Sankari
Honored Contributor

Re: FTP question

Hi,

yes you can used mdelete into your script
It should be mdelete not mdele

Suraj
TTr
Honored Contributor

Re: FTP question

> It should be mdelete...
All ftp commands can be shortened down to a few characters as long as they can be unique and parsed out from other commnads that begin with the same character(s). In this case the "mdelete" command can be shortened down to "mde" (mdir also starts with "md"). If you type "md" at the ftp prompt you get "ambiguous command error".
James R. Ferguson
Acclaimed Contributor

Re: FTP question

Hi:

I suggest you examine the documentation accompanying Perl's Net::FTP module:

http://search.cpan.org/~gbarr/libnet-1.22/Net/FTP.pm

You will find that there is a 'delete' method and 'rmdir' method. The later can be made recursive.

Regards!

...JRF...
Steven Schweda
Honored Contributor

Re: FTP question

> All ftp commands can be shortened down [...]

You're talking about _which_ FTP client
program? And the questioner is using what?
TTr
Honored Contributor

Re: FTP question

> You're talking about _which_ FTP client
program? And the questioner is using what?T

The questioner is using "mdele" instead of "mdelete" so I am sure he is using and is aware of the shortened commands.