[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: folder delete script

Tim Pease

4/2/2007 6:09:00 PM

On 4/2/07, Gus Hoppes <gushoppes@gmail.com> wrote:
> Hi. I am a rubyn00b. I need help. I'm trying to write a script that will
> delete specific sub folders in a particular folder. I would like to delete
> all folders that begin with lets say the letter "T" that are two weeks old.
> It would probably work like the deltree command in dos (deltree T*.* /s).
> How would I write that in ruby? Is it also possible to use wildcards in
> ruby? If so how? Any help would be greatly appreciated. TY!
>

The Dir.glob command will help you find folders that start with a
particular letter. The File.stat command will help you determine the
creation / modification times of those folders and whether or not they
are folders at all.

The documentation for these items can be found on the Ruby-doc website.

http://www.ruby-doc...

Have fun learning Ruby! Ruby has taught me more about programming
than any other language out there. The community is simply wonderful,
too.

Blessings,
TwP