From: Tim Hunter Date: 2008-01-19T17:49:09+09:00 Subject: Re: how to parse directory structure using ruby Saurabh Purnaye wrote: > Hi all, > Greetings.. > In my project i have stuck a place .. where i have to parse directory > structure. > Can you please help me out in this ? > The requirement is like... i will give input as name of directory.. > The program should act like to parse the whole directory structure and > give me output as, with all the directories/files with the name... Check out the "find" extension in the standard library. ri Find#find -------------------------------------------------------------- Find#find find(*paths) {|path| ...} ------------------------------------------------------------------------ Calls the associated block with the name of every file and directory listed as arguments, then recursively on their subdirectories, and so on. See the Find module documentation for an example. -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html