2006/2/21, Joby Bednar <CodeSlapper / gmail.com>:
> It might be more helpful to show what kind of output you want, rather
> than what code you've created.
>
> However, for a simple recursive directory listing, look more into the
> Dir object:
>
> depth = 1 #current or one directory down
> files = Dir['**/*'].reject {|item|
>         #filter out directories and directory depth
>         File.directory?(item) or File.dirname(item).split('/').size > depth
> }
> puts files
>
> You can add more logic to filter out other files, organize them in a
> tree-like structure, etc.  But, the Dir object and methods are VERY
> useful when used with File and other common Array and String methods.

Not that there is module Find which has recursion built in:

require 'find'
Find.find('.') {|f| puts f}

Kind regards

robert

--
Have a look: http://www.flickr.com/photos/fussel-foto/