[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Create a directories list with sub-directories
From:       Emmanuel Touzery <emmanuel.touzery () wanadoo ! fr>
Date:       2004-03-23 11:18:28
Message-ID: 40601D87.50609 () wanadoo ! fr
[Download RAW message or body]

Hello,

Dirk Einecke wrote:

> Hi.
>
> I've a problem. How can I create a directory list with all 
> sub-directories and files like this:
>
> |- root
>    |- folder1
>       |- filex
>    |- folder2
>       |- folderx
>          |- file1
>       |- filex
>       |- filey
>
> At the moment I've only a way to read one directory and print the 
> directories and files therein. But that is not enough. Can anybody 
> help me or give me a hint where I can helpfull examples?

To get all those files, simply do

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

emmanuel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic