From: Vassilis Rizopoulos Date: 2010-08-11T03:58:46+09:00 Subject: Re: Formatting directory listings On 10/08/10 20:25 , simonh wrote: > Hi. Given an (imaginary) directory structure like so: > > Movies/ > film1/film1.avi > film2/film2.avi > film3/film3.avi > etc. > > I'd like to get a directory listing like so: > > Movies > ==== > > film1 > film2 > film3 > etc. > > I don't want anyone to actually do this for me, rather point me to a > tutorial that deals with this sort of thing. > > By the way, I know that: > > films = Dir['**/*.avi'] > > will give me an array with the full pathnames. I'm after help with > extracting the parent directory name. > > Thanks for any help. Checkout Rake::FileList and especially Rake::FileList#pathmap which will go a long way towards doing what you want. Cheers, V.- -- http://www.ampelofilosofies.gr