CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
delete specific sub directories recurcively

 



Raju.b
New User

Feb 12, 2013, 12:51 AM

Post #1 of 2 (10526 views)
delete specific sub directories recurcively Can't Post

Hi,

I have written a perl script to checkout from CVS. I want to recurcively delete all the 'CVS' directories from every folder. How can I do that. Thanks in advance.

regards
Raju babannavar


FishMonger
Veteran / Moderator

Feb 12, 2013, 6:18 AM

Post #2 of 2 (10523 views)
Re: [Raju.b] delete specific sub directories recurcively [In reply to] Can't Post

Use the File::Find (or File::Find::Rule) module to traverse the directory tree deleting the directories as needed. You'll want to set no_chdir to true so that you can delete the current dir if needed.

http://search.cpan.org/~dom/perl-5.12.5/lib/File/Find.pm

You'll also want to use the File::Path module to handle the deletion process.

http://search.cpan.org/~dland/File-Path-2.09/Path.pm


(This post was edited by FishMonger on Feb 12, 2013, 6:20 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives