Gossamer Forum
Home : General : Perl Programming :

Remove Folders via FTP

Quote Reply
Remove Folders via FTP
Novice here....

I have to ftp into a server, move into a directory and remove some folders (below). How do I remove the folders in the directory /ep005/egate/client/iq/ ? I tried searching but could not find anything in the forums.

{2CE791F8-B956-11D7-8A47-D2047591D9E7} {E966E092-0086-11D7-AE05-ABCC420F384C}
{2D3A2FE4-B956-11D7-AA01-9928386F0C64} {E9684022-0086-11D7-AE05-B56CD20DA8C8}
{2EB061E0-B956-11D7-8FAD-A2B3FC810BD6} {E9699C1A-0086-11D7-AE05-DE7A183014AC}
{E9404D1A-0086-11D7-AE05-C74CFA34F9DD} {E96B2BC0-0086-11D7-AE05-B76DF22F3513}

I have tried:

1) File::Remove::remove "*";

2) system("rm -r {*}");

3) foreach $folder (@foldernames)

I think my answer would be rmdir but I want to be careful to only remove the folders within the iq direcotry. How would I use rmdir to accomplish this?

Last edited by:

perl_boy: Jan 30, 2004, 3:00 PM
Quote Reply
Re: [perl_boy] Remove Folders via FTP In reply to
Nevermind I got it....

@iqfiles_disco = $ftp_disco->ls; #where ftp_disco is the path below...

foreach $folder1 (@iqfiles_disco)
$ftp_disco->delete("/ep005/egate/client/iq/$folder1") || die " $! ";